<?php

namespace App\Modules\HR\Reports\Controllers;

use App\Http\Controllers\Controller;
use Illuminate\View\View;

class HrReportsPageController extends Controller
{
    public function index(): View
    {
        abort_unless(auth()->user()?->can('employees.view'), 403);

        return view('pages.hr.reports.index', [
            'links' => [
                [
                    'title' => __('hr_reports.links.employees'),
                    'description' => __('hr_reports.links.employees_hint'),
                    'route' => 'hr.employees.index',
                    'icon' => 'fe fe-users',
                    'permission' => 'employees.view',
                ],
                [
                    'title' => __('hr_reports.links.attendance'),
                    'description' => __('hr_reports.links.attendance_hint'),
                    'route' => 'hr.attendance.index',
                    'icon' => 'fe fe-calendar',
                    'permission' => 'attendance.view',
                ],
                [
                    'title' => __('hr_reports.links.attendance_monthly'),
                    'description' => __('hr_reports.links.attendance_monthly_hint'),
                    'route' => 'hr.attendance.monthly.index',
                    'icon' => 'fe fe-bar-chart-2',
                    'permission' => 'attendance.view',
                ],
                [
                    'title' => __('hr_reports.links.leave'),
                    'description' => __('hr_reports.links.leave_hint'),
                    'route' => 'hr.leave.requests.index',
                    'icon' => 'fe fe-briefcase',
                    'permission' => 'leave.view',
                ],
                [
                    'title' => __('hr_reports.links.payroll'),
                    'description' => __('hr_reports.links.payroll_hint'),
                    'route' => 'payroll.periods.index',
                    'icon' => 'fe fe-dollar-sign',
                    'permission' => 'payroll.view',
                ],
            ],
        ]);
    }
}
