<?php

declare(strict_types=1);

namespace App\Controllers;

use App\Core\Controller;
use App\Models\DemoData;
use App\Repositories\ReportRepository;
use App\Repositories\StatisticsRepository;

final class DashboardController extends Controller
{
    public function index(): string
    {
        $reports = new ReportRepository();
        $statistics = new StatisticsRepository();

        return $this->view('dashboard/index', [
            'title' => 'Табло',
            'user' => DemoData::user(),
            'reports' => $reports->latest(),
            'overview' => $statistics->overview(),
            'municipalities' => $statistics->byMunicipality(),
            'deadlines' => $statistics->deadlines(),
            'transparency' => $statistics->transparency(),
            'qrLinks' => DemoData::qrLinks(),
        ]);
    }
}
