<?php

namespace Plainwork\Ui\Component\Form;

use Plainwork\Ui\Component\AbstractTag;

class Button extends AbstractTag
{
    private string $name = '';
    private $value = null;
    private array $label = [];
    private bool $isDanger = false;
    private bool $isPrimary = true;

    public function __construct(...$label)
    {
        $this->setLabel($label);
    }

    public function getName(): string
    {
        return $this->name;
    }

    public function setName(string $name): self
    {
        $this->name = $name;

        return $this;
    }

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

    public function setValue($value): self
    {
        $this->value = $value;

        return $this;
    }

    public function getLabel(): array
    {
        return $this->label;
    }

    public function setLabel($label): self
    {
        $this->label = $label;

        return $this;
    }

    public function isDanger(): bool
    {
        return $this->isDanger;
    }

    public function setDanger(bool $isDanger = true): self
    {
        $this->isDanger = $isDanger;

        return $this;
    }

    public function isPrimary(): bool
    {
        return $this->isPrimary;
    }

    public function setPrimary(bool $isPrimary = true): self
    {
        $this->isPrimary = $isPrimary;

        return $this;
    }
}
