@props([
    'action',
    'method' => 'POST',
    'employee' => null,
    'departmentOptions' => [],
    'positionOptions' => [],
    'managerOptions' => [],
    'employmentStatusOptions' => [],
    'defaultEmploymentStatusId' => null,
    'countryOptions' => [],
    'submitLabel',
    'customFieldDefinitions' => null,
    'customFieldValues' => [],
])

<form method="POST" action="{{ $action }}" enctype="multipart/form-data" novalidate>
    @csrf
    @if (strtoupper($method) !== 'POST')
        @method($method)
    @endif

    <div class="card mb-3">
        <div class="card-header bg-white">
            <strong>{{ __('employees.singular') }}</strong>
        </div>
        <div class="card-body">
            @include('pages.hr.employees._partials.employee-fields', [
                'employee' => $employee,
                'departmentOptions' => $departmentOptions,
                'positionOptions' => $positionOptions,
                'managerOptions' => $managerOptions,
                'employmentStatusOptions' => $employmentStatusOptions,
                'defaultEmploymentStatusId' => $defaultEmploymentStatusId,
            ])
        </div>
    </div>

    <div class="card mb-3">
        <div class="card-header bg-white">
            <strong>{{ __('employees.fields.address_heading') }}</strong>
        </div>
        <div class="card-body">
            @include('pages.hr.employees._partials.address-fields', [
                'employee' => $employee,
                'countryOptions' => $countryOptions,
            ])
        </div>
    </div>

    <div class="card mb-3">
        <div class="card-header bg-white">
            <strong>{{ __('employees.fields.documents_heading') }}</strong>
        </div>
        <div class="card-body">
            @include('pages.hr.employees._partials.document-fields', ['employee' => $employee])
        </div>
    </div>

    @if ($customFieldDefinitions !== null && $customFieldDefinitions->count() > 0)
        <div class="card mb-3">
            <div class="card-header bg-white">
                <strong>{{ __('custom_fields.employee_section') }}</strong>
            </div>
            <div class="card-body">
                @include('pages.hr.employees._partials.custom-fields', [
                    'definitions' => $customFieldDefinitions,
                    'values' => $customFieldValues,
                ])
            </div>
        </div>
    @endif

    <div class="d-flex justify-content-end gap-2">
        <x-ui.buttons.secondary :href="route('hr.employees.index')">
            {{ __('common.cancel') }}
        </x-ui.buttons.secondary>
        <x-ui.buttons.primary type="submit" icon="fe fe-save">
            {{ $submitLabel }}
        </x-ui.buttons.primary>
    </div>
</form>
