<?php

namespace App\Http\Controllers\ParentPortal;

use App\Http\Controllers\Admin\PageController;
use App\Http\Controllers\ParentPortal\Concerns\ResolvesParentScope;
use App\Services\School\AcademicDashboardService;
use Illuminate\View\View;

class DashboardController extends PageController
{
    use ResolvesParentScope;

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

    public function index(): View
    {
        $stats = $this->dashboard->parentStats($this->activeStudent());

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