@php
    $breadcrumbs = [
        ['label' => __('common.home'), 'url' => route('dashboard.index')],
        ['label' => __('common.hr')],
        ['label' => __('employees.title'), 'url' => route('hr.employees.index')],
        ['label' => __('employees.edit_title')],
    ];
@endphp

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

    @include('pages.hr.employees._partials.linked-user-account', [
        'employee' => $employee,
        'linkedUser' => $linkedUser ?? null,
        'roles' => $roles ?? collect(),
        'unlinkedUserOptions' => $unlinkedUserOptions ?? [],
        'defaultRoleIds' => $defaultRoleIds ?? [],
    ])

    @include('pages.hr.employees._form', [
        'action' => route('hr.employees.update', $employee),
        'method' => 'PUT',
        'employee' => $employee,
        'departmentOptions' => $departmentOptions,
        'positionOptions' => $positionOptions,
        'managerOptions' => $managerOptions ?? [],
        'employmentStatusOptions' => $employmentStatusOptions ?? [],
        'defaultEmploymentStatusId' => $defaultEmploymentStatusId ?? null,
        'countryOptions' => $countryOptions ?? [],
        'submitLabel' => __('employees.actions.update'),
        'customFieldDefinitions' => $customFieldDefinitions,
        'customFieldValues' => $customFieldValues,
    ])
</x-ui.layout.page>
