@if ($tabData === null || $tabData->isEmpty())
    <x-ui.operational.empty-state :title="__('recruitment.vacancies.empty_tab.offers')" />
@else
    <div class="table-responsive">
        <table class="table table-hover align-middle mb-0">
            <thead>
                <tr>
                    <th>{{ __('recruitment.offer_letters.fields.reference') }}</th>
                    <th>{{ __('recruitment.offer_letters.fields.candidate') }}</th>
                    <th>{{ __('recruitment.offer_letters.fields.employment_type') }}</th>
                    <th>{{ __('recruitment.offer_letters.fields.status') }}</th>
                    <th></th>
                </tr>
            </thead>
            <tbody>
                @foreach ($tabData as $row)
                    <tr>
                        <td><code>{{ $row->reference_code }}</code></td>
                        <td>{{ $row->candidate?->full_name ?? '—' }}</td>
                        <td>{{ __('recruitment.offer_letters.employment_type.'.$row->employment_type) }}</td>
                        <td>{{ __('recruitment.offer_letters.status.'.$row->status) }}</td>
                        <td class="text-end">
                            <a href="{{ route('hr.recruitment.offer-letters.show', $row) }}" class="small">{{ __('common.view') }}</a>
                        </td>
                    </tr>
                @endforeach
            </tbody>
        </table>
    </div>
    @if (method_exists($tabData, 'hasPages') && $tabData->hasPages())
        <div class="mt-3">{{ $tabData->links() }}</div>
    @endif
@endif
