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

<x-ui.layout.page
    :title="__('hr_reports.title')"
    :subtitle="__('hr_reports.subtitle')"
    page-icon="fe fe-bar-chart-2"
    :breadcrumbs="$breadcrumbs"
>
    @foreach ($groups as $category => $reports)
        <div class="card mb-3">
            <div class="card-header"><h3 class="card-title">{{ __("hr_reports.categories.$category") }}</h3></div>
            <div class="list-group list-group-flush">
                @foreach ($reports as $report)
                    <a class="list-group-item list-group-item-action d-flex justify-content-between"
                       href="{{ route('hr.reports.show', $report) }}">
                        <span>{{ $report->label() }}</span><i class="fe fe-chevron-right"></i>
                    </a>
                @endforeach
            </div>
        </div>
    @endforeach

    @can('recruitment.reports.view')
        <div class="card">
            <div class="card-body d-flex justify-content-between align-items-center">
                <div>
                    <h3 class="card-title mb-1">{{ __('hr_reports.categories.recruitment') }}</h3>
                    <p class="text-muted mb-0">{{ __('hr_reports.recruitment_reuse') }}</p>
                </div>
                <x-ui.buttons.secondary :href="route('hr.recruitment.reports.index')">
                    {{ __('common.view') }}
                </x-ui.buttons.secondary>
            </div>
        </div>
    @endcan
</x-ui.layout.page>
