@php /** @var \App\Models\Menu|null $menu */ @endphp
<div class="row g-3">
    <div class="col-md-6">
        <label class="form-label">{{ __('admin/menus.fields_name') }} <span class="text-danger">*</span></label>
        <input type="text" name="name" class="form-control @error('name') is-invalid @enderror"
               value="{{ old('name', $menu->name ?? '') }}" required maxlength="120">
        @error('name')<div class="invalid-feedback">{{ $message }}</div>@enderror
    </div>
    <div class="col-md-3">
        <label class="form-label">{{ __('admin/menus.fields_slug') }} <span class="text-danger">*</span></label>
        <input type="text" name="slug" class="form-control @error('slug') is-invalid @enderror"
               value="{{ old('slug', $menu->slug ?? '') }}" required pattern="[a-z0-9_\-]{1,64}">
        @error('slug')<div class="invalid-feedback">{{ $message }}</div>@enderror
        <div class="form-text small">{{ __('admin/menus.slug_help') }}</div>
    </div>
    <div class="col-md-3">
        <label class="form-label">{{ __('admin/menus.fields_brand') }}</label>
        <select name="brand_id" class="form-select">
            <option value="">{{ __('admin/menus.fields_brand_master') }}</option>
            @foreach($brands as $brand)
                <option value="{{ $brand->id }}" @selected(old('brand_id', $menu->brand_id ?? '') == $brand->id)>
                    {{ $brand->name }}
                </option>
            @endforeach
        </select>
    </div>
    <div class="col-12">
        <div class="form-check form-switch">
            <input type="hidden" name="is_active" value="0">
            <input type="checkbox" name="is_active" value="1" id="menuIsActive"
                   class="form-check-input" @checked(old('is_active', $menu->is_active ?? true))>
            <label class="form-check-label" for="menuIsActive">{{ __('admin/menus.fields_is_active') }}</label>
        </div>
    </div>
</div>
