<?php

declare(strict_types=1);

namespace App\Controllers\Admin;

use App\Core\Request;
use App\Core\Response;
use App\Core\View;

final class DashboardController extends AdminController
{
    /** @param array<string,string> $params */
    public function index(Request $request, array $params): Response
    {
        if ($redirect = $this->guard()) {
            return $redirect;
        }

        return Response::html(View::render('admin/dashboard', [
            'pageTitle' => 'Tableau de bord',
        ], 'layouts/admin'));
    }
}
