@props(['asset' => null])

<div class="row g-3 mb-3">
    <div class="col-md-3">
        <x-ui.form.input name="asset_code" :label="__('employees.assets.asset_code')" :value="$asset?->asset_code" required />
    </div>
    <div class="col-md-3">
        <x-ui.form.input name="asset_name" :label="__('employees.assets.asset_name')" :value="$asset?->asset_name" required />
    </div>
    <div class="col-md-3">
        <x-ui.form.input name="category" :label="__('employees.assets.category')" :value="$asset?->category" />
    </div>
    <div class="col-md-3">
        <x-ui.form.input name="assigned_at" type="date" :label="__('employees.assets.assigned_at')"
            :value="old('assigned_at', $asset?->assigned_at?->format('Y-m-d') ?? now()->toDateString())" required />
    </div>
    <div class="col-md-3">
        <x-ui.form.input name="returned_at" type="date" :label="__('employees.assets.returned_at')"
            :value="old('returned_at', $asset?->returned_at?->format('Y-m-d'))" />
    </div>
    <div class="col-md-3">
        <x-ui.form.select
            name="status"
            :label="__('employees.assets.status')"
            :options="[
                'assigned' => __('employees.assets.statuses.assigned'),
                'returned' => __('employees.assets.statuses.returned'),
                'lost' => __('employees.assets.statuses.lost'),
            ]"
            :selected="old('status', $asset?->status ?? 'assigned')"
            required
        />
    </div>
    <div class="col-md-3">
        <x-ui.form.input name="external_asset_id" type="number" min="1"
            :label="__('employees.assets.external_asset_id')" :value="$asset?->external_asset_id" />
    </div>
    <div class="col-md-3">
        <x-ui.form.input name="notes" :label="__('employees.assets.notes')" :value="$asset?->notes" />
    </div>
</div>
