<x-app-layout>
    <x-slot name="header">
        <h2 class="h4 mb-0">Countdown Pilkades</h2>
    </x-slot>

    <div class="card" style="max-width: 500px;">
        <div class="card-body">
            <form action="{{ route('admin-desa.countdown.update') }}" method="POST">
                @csrf @method('PUT')

                <div class="mb-3">
                    <x-input-label for="label" value="Label" />
                    <x-text-input id="label" name="label" value="{{ old('label', $countdown->label) }}" required />
                </div>

                <div class="mb-3">
                    <x-input-label for="target_datetime" value="Tanggal &amp; Waktu Target" />
                    <input type="datetime-local" id="target_datetime" name="target_datetime" class="form-control"
                           value="{{ old('target_datetime', $countdown->target_datetime?->format('Y-m-d\TH:i')) }}" required>
                </div>

                <div class="mb-3 form-check form-switch">
                    <input type="checkbox" class="form-check-input" id="is_active" name="is_active" value="1"
                           {{ old('is_active', $countdown->is_active) ? 'checked' : '' }}>
                    <label class="form-check-label" for="is_active">Tampilkan Countdown</label>
                </div>

                <button class="btn btn-primary">Simpan</button>
            </form>
        </div>
    </div>
</x-app-layout>
