<?php

namespace KupShop\ComponentsBundle\Twig\Components\Account\OrderDetail;

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

#[AsTwigComponent(template: '@Components/components/Account/OrderDetail/History/History.1.html.twig')]
#[Component(1, [
    new Version(1, newJs: null),
])]
class History extends BaseComponent
{
    use OrderDataTrait;

    protected array $history;

    public function getHistory(): array
    {
        if (!isset($this->history)) {
            $this->history = $this->order->getHistory();
        }

        return $this->history;
    }
}
