@extends('layouts.app')

@section('content')
    <div class="row justify-content-center">
        <div class="col-lg-6">
            <div class="card shadow-sm">
                <div class="card-header fw-bold">Edit Continent</div>
                <div class="card-body">
                    <form method="POST" action="{{ route('continents.update', $continent) }}" class="row g-2">
                        @csrf
                        @method('PUT')
                        <div class="col-12">
                            <label class="form-label">Name</label>
                            <input name="name" class="form-control" required maxlength="100" value="{{ old('name', $continent->name) }}">
                        </div>
                        <div class="col-12">
                            <label class="form-label">Code</label>
                            <input name="code" class="form-control" required maxlength="10" value="{{ old('code', $continent->code) }}">
                        </div>
                        <div class="col-12">
                            <label class="form-label">Status</label>
                            <select name="status" class="form-select">
                                <option value="1" {{ old('status', $continent->status) == 1 ? 'selected' : '' }}>Active</option>
                                <option value="0" {{ old('status', $continent->status) === '0' || old('status', $continent->status) === 0 ? 'selected' : '' }}>Inactive</option>
                            </select>
                        </div>
                        <div class="col-12 d-flex gap-2">
                            <button class="btn btn-primary">Update</button>
                            <a href="{{ route('continents.index') }}" class="btn btn-outline-secondary">Back</a>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
@endsection
