<?php

namespace Modules\Page\Controllers\Web;

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

class PageController extends Controller
{
    private $viewDirectory= 'web.pages.pages.';

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

    public function conditions()
    {
        $page = $this->pageService->getItemById(4);

        $title = $page->currentDescription->title;

        return view($this->viewDirectory.'page',get_defined_vars());
    }
    public function terms()
    {
        $page = $this->pageService->getItemById(5);

        $title = $page->currentDescription->title;

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

    public function about()
    {
        $page = $this->pageService->getItemById(1);
        $title = $page->currentDescription->title;

        // Get additional data for vision, partners, and testimonials sections
        $numbersPage = $this->pageService->getItemById(10);
        $partnersPage = $this->pageService->getItemById(11);
        $testimonialsPage = $this->pageService->getItemById(14);

        // Get Vision, Mission, and Goals pages (same as home page)
        $visionPage = $this->pageService->getItemById(2);
        $missionPage = $this->pageService->getItemById(8);
        $goalsPage = $this->pageService->getItemById(9);

        // Get brands/partners data
        $brands = app(\Modules\Brand\Services\BrandService::class)->get();

        // Get reviews/testimonials data
        $reviews = app(\Modules\Review\Services\ReviewService::class)->get();

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


}
