<?php

namespace App\Http\Controllers;

use App\Models\ClassType;
use App\Models\ContentBlock;
use App\Services\ScheduleService;
use Illuminate\View\View;

class ClassesController extends Controller
{
    public function __construct(private ScheduleService $schedule) {}

    public function index(): View
    {
        return view('pages.classes', [
            'page' => 'classes',
            'blocks' => ContentBlock::forPage('classes'),
            'classTypes' => ClassType::query()->where('is_active', true)->orderBy('sort_order')->get(),
            'sessionsByDay' => $this->schedule->sessionsByDay(),
            'weekDates' => $this->schedule->weekDates(),
        ]);
    }
}
