<?php

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

use KupShop\ComponentsBundle\Attributes\Component;
use KupShop\ComponentsBundle\Attributes\Version;
use KupShop\ComponentsBundle\Entity\Thumbnail;
use KupShop\ComponentsBundle\Twig\BaseComponent;
use KupShop\ComponentsBundle\Twig\DataProvider\ProductDataTrait;
use Symfony\UX\TwigComponent\Attribute\AsTwigComponent;

#[AsTwigComponent(template: '@Components/components/Product/Gifts/GiftRow/GiftRow.1.html.twig')]
#[Component(1, [
    new Version(1, newJs: null),
])]
class GiftRow extends BaseComponent
{
    use ProductDataTrait;

    public string $title;

    public function getTitle(): string
    {
        return $this->provider->getTitle($this->product->id);
    }

    public function getUrl(): string
    {
        return $this->provider->getUrl($this->product->id);
    }

    public function getThumbnail(): ?Thumbnail
    {
        return $this->provider->getThumbnail($this->product->id);
    }
}
