@extends('layouts.app')

@section('content')
    <x-card>
        <div class="mb-6">
            <h2 class="text-2xl font-semibold text-slate-900">Edit Meja</h2>
            <p class="text-sm text-slate-500">Perbarui informasi meja.</p>
        </div>
        <form method="post" action="{{ route('mejas.update', $meja) }}" class="grid gap-4 md:grid-cols-2">
            @csrf
            @method('put')
            <x-input name="no_meja" label="No Meja" :value="$meja->no_meja" required />

            <div class="md:col-span-2">
                <label class="inline-flex items-center gap-2 text-sm font-semibold text-slate-700">
                    <input type="checkbox" name="is_active" value="1" class="rounded border-slate-300" {{ old('is_active', $meja->is_active) ? 'checked' : '' }}>
                    Aktif
                </label>
            </div>

            <div class="flex gap-3 md:col-span-2">
                <x-button type="submit">Update</x-button>
                <x-button href="{{ route('mejas.index') }}" variant="secondary">Kembali</x-button>
            </div>
        </form>
    </x-card>
@endsection
