<?php
namespace App\Components\Www;

use App\Entity\Sponsor;
use App\Repository\SponsorRepository;
use Symfony\UX\TwigComponent\Attribute\AsTwigComponent;

#[AsTwigComponent(name: 'MetaSEO', template: "www/components/meta-seo.html.twig")]
class MetaSEO
{
    public function __construct(private SponsorRepository $sponsorRepository)
    {
    }

    public function getSponsorsList(): string
    {
        $sponsors = $this->sponsorRepository->findAllActive(true, false);

        $list = "";
        foreach ($sponsors as $sponsor) {
            $list .= " " . $sponsor->getName();
        }

        return $list;

    }
}