<?php

namespace Plainwork\Ui\Component;

final class Ul extends AbstractTag
{
    private array $items = [];

    public function __construct(...$items)
    {
        if ((1 === count($items)) && is_array(current($items))){
            $items = current($items);
        }

        $this->items = $items;
    }

    public function add($item): self
    {
        $this->items[] = $item;

        return $this;
    }

    public function getItems(): array
    {
        return $this->items;
    }
}
