<?php
// src/Controller/FrontendController.php

declare(strict_types=1);

namespace App\Controller;

use App\Repository\QuotesRepository;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;

/**
 *
 */
class FrontendController extends AbstractController
{
    #[Route(path: '/', name: 'app_main')]
    public function quote(QuotesRepository $quotesRepository): Response
    {
        $user = $this->getUser();
        $quote = $quotesRepository->findOneRandom();

        return $this->render(view: '@default/base.html.twig', parameters: [
	        'user' => $user,
	        'quote' => $quote->getQuote()
        ]);
    }
}
