<?php

namespace KupShop\ComponentsBundle\Twig\Components\Product\Collections;

use KupShop\ComponentsBundle\Attributes\Component;
use KupShop\ComponentsBundle\Attributes\Version;
use KupShop\ComponentsBundle\Entity\CollectionProduct;
use Symfony\UX\TwigComponent\Attribute\AsTwigComponent;

#[AsTwigComponent(template: '@Components/components/Product/Collections/ColorsCatalog/ColorsCatalog.1.html.twig')]
#[Component(1, [
    new Version(1),
])]
class ColorsCatalog extends SquaresCatalog
{
    public function getColorCode(CollectionProduct $product): ?string
    {
        return $product->getProductParams()[$this->id_parameter]['description'] ?? null;
    }
}
