<?php

/*
 * This file is part of the VITICORE2 package.
 *
 * (c) CP Creation <web@cpcreation.fr>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace CpCreation\VitiCore\Bridge\Symfony\Bundle\Twig\Components\Shop;

use CpCreation\VitiCore\Shop\Model\ShopConfig;
use Symfony\UX\TwigComponent\Attribute\AsTwigComponent;

#[AsTwigComponent('shop:Vacation', template: '@components/shop/Vacation.html.twig')]
final class Vacation
{
    public ShopConfig $config;
    public ?string $template = null;

    public function isActive(): bool
    {
        return $this->config->isVacationActive();
    }

    public function isBlocking(): bool
    {
        return $this->config->isShopDisabledForVacation();
    }
}
