<?php

namespace Modules\Team\Controllers\Web;

use App\Http\Controllers\Controller;
use Modules\Team\Services\TeamService;
use Modules\Page\Services\PageService;

class TeamController extends Controller
{
    private string $viewDirectory = 'web.pages.team.';

    public function __construct(
        private TeamService $teamService,
        private PageService $pageService,
    ) {}

    public function index()
    {
        // Get team page content from Page model (ID 16)
        $page = $this->pageService->getItemById(16);
        $title = $page->currentDescription->title;

        // Get team data from Team model
        $teams = $this->teamService->get();

        return view($this->viewDirectory . 'index', get_defined_vars());
    }
}
