<x-ui.layout.page :title="__('performance.reviews')" page-icon="fe fe-star">
    @can('performance.create')
        <div class="card mb-3"><div class="card-body">
            <form method="POST" action="{{ route('hr.performance.reviews.store') }}" class="row g-3">@csrf
                <div class="col-md-5"><x-ui.form.search-select name="employee_id" lookup="employees" :label="__('performance.fields.employee')" :options="$employees" required /></div>
                <div class="col-md-5"><x-ui.form.search-select name="cycle_id" :label="__('performance.fields.cycle')" :options="$cycles" required /></div>
                <div class="col-md-2 d-flex align-items-end"><x-ui.buttons.primary type="submit">{{ __('common.save') }}</x-ui.buttons.primary></div>
            </form>
        </div></div>
    @endcan
    <x-ui.operational.index-shell>
        <x-ui.table.table :columns="[['label'=>__('performance.fields.employee')],['label'=>__('performance.fields.cycle')],['label'=>__('performance.fields.self_score')],['label'=>__('performance.fields.manager_score')],['label'=>__('performance.fields.status')]]">
            @forelse($reviews as $review)
                <x-ui.table.row><td>{{ $review->employee?->full_name ?? '—' }}</td><td>{{ $review->cycle?->name ?? '—' }}</td><td>{{ $review->self_score ?? '—' }}</td><td>{{ $review->manager_score ?? '—' }}</td><td>{{ __('performance.status.'.$review->status) }}</td></x-ui.table.row>
            @empty<x-ui.table.row><td colspan="5"><x-ui.operational.empty-state :title="__('performance.empty_reviews')" /></td></x-ui.table.row>@endforelse
        </x-ui.table.table>
        <x-slot:pagination>{{ $reviews->links() }}</x-slot:pagination>
    </x-ui.operational.index-shell>
</x-ui.layout.page>
