@extends('layouts.app')
@section('title', '編集')

@section('content')
    {{-- Content Header --}}
    <div class="content-header">
        <div class="container-fluid">
            <div class="row mb-2">
                <div class="col-lg-6">
                    <h1 class="m-0 text-dark">編集</h1>
                </div>
                
                <div class="col-lg-6">
                    <ol class="breadcrumb float-sm-right text-sm">
                        <li class="breadcrumb-item">
                            <a href="./index2.html">ホーム</a>
                        </li>
                        <li class="breadcrumb-item">
                            <a href="{{ route('devices') }}">デバイスマスタ</a>
                        </li>
                        <li class="breadcrumb-item active">編集</li>
                    </ol>
                </div>
            </div>
        </div>
    </div>

    {{-- Main Content --}}
    <section class="content">
        <div class="container-fluid">
            <div class="row">
                <div class="col-lg-12">
                    <div class="card">
                        {{-- Edit Form --}}
                        <form id="form_edit" 
                              action="{{ route('devices_edit', ['id' => $device->device_id]) }}" 
                              method="POST">
                            @csrf
                            @include('admin.devices._form', ['isEdit' => true])
                        </form>

                        {{-- Delete Form --}}
                        <form id="form_delete" 
                              action="{{ route('devices_delete') }}" 
                              method="POST" 
                              style="display:none;">
                            @csrf
                            <input type="hidden" name="id" value="{{ $device->device_id }}">
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </section>
@endsection
