@php $history = $history ?? null; @endphp
<div class="row g-3 mb-3">
    <div class="col-md-4">
        <x-ui.form.select name="type" :label="__('employees.employment_history.type')"
            :options="collect(\App\Modules\HR\Employees\Enums\EmploymentHistoryType::cases())->mapWithKeys(fn ($type) => [$type->value => __('employees.employment_history.types.'.$type->value)])->all()"
            :selected="old('type', $history?->type?->value)" required />
    </div>
    <div class="col-md-4">
        <x-ui.form.input name="effective_date" type="date" :label="__('employees.employment_history.effective_date')"
            :value="old('effective_date', $history?->effective_date?->format('Y-m-d'))" required />
    </div>
    <div class="col-md-4"><x-ui.form.input name="reason" :label="__('employees.employment_history.reason')" :value="$history?->reason" /></div>
    <div class="col-md-6"><x-ui.form.input name="previous_value" :label="__('employees.employment_history.previous_value')" :value="$history?->previous_value" /></div>
    <div class="col-md-6"><x-ui.form.input name="new_value" :label="__('employees.employment_history.new_value')" :value="$history?->new_value" /></div>
    <div class="col-12"><x-ui.form.input name="notes" :label="__('employees.employment_history.notes')" :value="$history?->notes" /></div>
</div>
