@props([
    'action',
    'method' => 'POST',
    'candidate' => null,
    'submitLabel',
])

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

    <div class="card">
        <div class="card-body">
            <div class="row g-3">
                <div class="col-md-6">
                    <x-ui.form.input name="first_name" :label="__('recruitment.candidates.fields.first_name')" :value="old('first_name', $candidate?->first_name)" required />
                </div>
                <div class="col-md-6">
                    <x-ui.form.input name="last_name" :label="__('recruitment.candidates.fields.last_name')" :value="old('last_name', $candidate?->last_name)" required />
                </div>
                <div class="col-md-6">
                    <x-ui.form.input name="email" type="email" :label="__('recruitment.candidates.fields.email')" :value="old('email', $candidate?->email)" />
                </div>
                <div class="col-md-6">
                    <x-ui.form.input name="phone" :label="__('recruitment.candidates.fields.phone')" :value="old('phone', $candidate?->phone)" />
                </div>
                <div class="col-md-6">
                    <x-ui.form.input name="nationality" :label="__('recruitment.candidates.fields.nationality')" :value="old('nationality', $candidate?->nationality)" />
                </div>
                <div class="col-md-6">
                    <x-ui.form.input name="source" :label="__('recruitment.candidates.fields.source')" :value="old('source', $candidate?->source)" />
                </div>
                <div class="col-12">
                    <x-ui.form.input name="notes" :label="__('recruitment.candidates.fields.notes')" :value="old('notes', $candidate?->notes)" />
                </div>
            </div>
        </div>
        <div class="card-footer d-flex justify-content-end gap-2 bg-white">
            <x-ui.buttons.secondary :href="route('hr.recruitment.candidates.index')">{{ __('common.cancel') }}</x-ui.buttons.secondary>
            <x-ui.buttons.primary type="submit">{{ $submitLabel }}</x-ui.buttons.primary>
        </div>
    </div>
</form>
