<?php

declare(strict_types=1);

namespace App\Controllers;

use App\Models\AdminUser;
use App\Support\Diagnostics;
use Core\Controller;

final class AdminDiagnosticsController extends Controller
{
    public function index(): void
    {
        $this->requireAdminRole();

        $checks = Diagnostics::run(true);
        $summary = Diagnostics::summarize($checks);

        $this->view('admin/system/check', [
            'checks' => $checks,
            'summary' => $summary,
            'adminUser' => AdminUser::current(),
        ], 'admin');
    }
}
