<?php

namespace Modules\Page\Controllers\Web;

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

class ContactController extends Controller
{
    private string $viewDirectory = 'web.pages.contact.';

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

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

        // Get contact information from settings
        $email = settings('site_email');
        $phone = settings('site_phone');
        $address = settings('site_address_'.app()->getLocale());

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