<?php

namespace KupShop\ComponentsBundle\Twig\Components\Switcher\Country;

use KupShop\ComponentsBundle\Attributes\Component;
use KupShop\ComponentsBundle\Attributes\Version;
use KupShop\ComponentsBundle\Twig\BaseComponent;
use KupShop\KupShopBundle\Context\CountryContext;
use Symfony\UX\TwigComponent\Attribute\AsTwigComponent;

#[AsTwigComponent(template: '@Components/components/Switcher/Country/Trigger/Trigger.1.html.twig')]
#[Component(1, [
    new Version(1, newJs: null),
])]
class Trigger extends BaseComponent
{
    public bool $renderByJsShop = false;

    public function __construct(private readonly CountryContext $countryContext)
    {
    }

    public function getActiveCountry(): \KupShop\I18nBundle\Entity\Country
    {
        return $this->countryContext->getActive();
    }
}
