<?php

namespace apexl\Io\modules\display\components;

use apexl\Io\modules\component\Collections\ComponentCollection;
use apexl\Io\modules\component\Collections\ComponentPropertyCollection;
use apexl\Io\modules\component\Component\Component;
use apexl\Io\modules\component\Factories\ComponentPropertyFactory;
use Arrayy\Type\StringCollection;

readonly class FileButton extends Component
{
    public function __construct(
        ComponentPropertyFactory $propertyFactory,
        ComponentPropertyCollection $props,
        ComponentCollection $components,
        StringCollection $classes,
        ?string $componentId = null
    ) {
        parent::__construct($propertyFactory, $props, $components, $classes, $componentId);
        $this->addRoute('/');
        $this->addText('');
    }

    public function addRoute($route)
    {
        $this->setProperty('route', $route);
        return $this;
    }

    public function addText($text)
    {
        $this->setProperty('text', $text);
        return $this;
    }

    public function addIcon($icon)
    {
        $this->setProperty('icon', $icon);
        return $this;
    }

    public function disabled($disabled = FALSE)
    {
        $this->setProperty('disabled', $disabled);
        return $this;
    }

}