<?php

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

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

#[AsTwigComponent(template: '@Components/components/Product/Parameters/Progress/Progress.1.html.twig')]
#[Component(1, [
    new Version(1, newJs: null),
])]
class Progress extends BaseComponent
{
    public string $text_value;
    protected int $value;
    protected int $max;

    public function mount(array $value): array
    {
        $this->max = $value['data']['progress']['max'] ?? 0;
        $this->value = $value['data']['progress']['value'] ?? 0;

        return [];
    }

    public function getValue(): int
    {
        return $this->value;
    }

    public function getMax(): int
    {
        return $this->max;
    }
}
