<?php

namespace App\Http\Controllers\Student;

use App\Http\Controllers\Admin\PageController;
use App\Http\Controllers\Student\Concerns\ResolvesStudentScope;
use App\Services\School\AcademicDashboardService;
use Illuminate\View\View;

class DashboardController extends PageController
{
    use ResolvesStudentScope;

    public function __construct(private readonly AcademicDashboardService $dashboard) {}

    public function index(): View
    {
        $stats = $this->dashboard->studentStats($this->studentScope()->student());

        return $this->page('student.dashboard.index', array_merge([
            'crumbTitle' => 'Student Portal',
            'crumbSub' => 'Welcome',
        ], $stats));
    }
}
