@php
    use App\Modules\HR\Shifts\Support\ShiftWeekday;
    $breadcrumbs = [
        ['label' => __('common.home'), 'url' => route('dashboard.index')],
        ['label' => __('common.hr')],
        ['label' => __('shifts.title'), 'url' => route('hr.shifts.index')],
        ['label' => __('shifts.edit_title')],
    ];
    $weekdayOptions = collect(ShiftWeekday::all())->mapWithKeys(fn (string $d): array => [$d => __("shifts.weekday.$d")])->all();
@endphp

<x-ui.layout.page
    :title="__('shifts.edit_title')"
    page-icon="fe fe-edit-2"
    :breadcrumbs="$breadcrumbs"
>
    <x-slot:actions>
        <x-ui.buttons.secondary :href="route('hr.shifts.index')" icon="fe fe-arrow-left">
            {{ __('shifts.actions.back') }}
        </x-ui.buttons.secondary>
    </x-slot:actions>

    @include('pages.hr.shifts._form', [
        'action' => route('hr.shifts.update', $shift),
        'method' => 'PUT',
        'shift' => $shift,
        'submitLabel' => __('common.update'),
        'weekdayOptions' => $weekdayOptions,
    ])

    @push('scripts')
        @vite(['resources/js/modules/hr/shifts/main.js'])
    @endpush
</x-ui.layout.page>
