@php $category = $category ?? null; @endphp
<div>
    <label class="block text-sm font-medium mb-1">Üst Kategori</label>
    <select name="parent_id" class="w-full border rounded px-3 py-2">
        <option value="">Yok</option>
        @foreach ($parents as $parent)
            <option value="{{ $parent->id }}" @selected(old('parent_id', $category?->parent_id)==$parent->id)>{{ $parent->name }}</option>
        @endforeach
    </select>
</div>
<div>
    <label class="block text-sm font-medium mb-1">Kategori Adı</label>
    <input type="text" name="name" value="{{ old('name', $category?->name) }}" required class="w-full border rounded px-3 py-2">
</div>
<div>
    <label class="block text-sm font-medium mb-1">Açıklama</label>
    <textarea name="description" class="w-full border rounded px-3 py-2">{{ old('description', $category?->description) }}</textarea>
</div>
<div>
    <label class="block text-sm font-medium mb-1">Durum</label>
    <select name="status" class="w-full border rounded px-3 py-2">
        <option value="active" @selected(old('status', $category?->status ?? 'active')==='active')>Aktif</option>
        <option value="passive" @selected(old('status', $category?->status)==='passive')>Pasif</option>
    </select>
</div>
