<?php

namespace Apexl\Io\Display\Components;

use Apexl\Io\Component\Collections\ComponentCollection;
use Apexl\Io\Component\Collections\ComponentPropertyCollection;
use Apexl\Io\Component\Components\Component;
use Apexl\Io\Component\Factories\ComponentPropertyFactory;
use Arrayy\Type\StringCollection;

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

    public function addTitle($text): ColWrapper
    {
        $this->setProperty('title', $text);
        return $this;
    }

    public function setStartDate(\DateTime $startTime)
    {
        $this->setProperty('startDate', $startTime->format('Y-m-d'));
        return $this;
    }

    public function setEndDate(\DateTime $endTime)
    {
        $this->setProperty('endDate', $endTime->format('Y-m-d'));
        return $this;
    }
}
