<?php

declare(strict_types=1);

namespace Seka\Terminy\Http\Controllers\Livewire\Components\Udalosti;

use Livewire\Component;
use Illuminate\Contracts\View\View;
use Seka\Terminy\Models\Udalost\DruhUdalosti;

/**
 * Class Druh
 *
 * @package Seka\Terminy\Http\Controllers\Livewire\Components\Udalosti
 */
final class Druh extends Component
{
    /**
     * @var \Seka\Terminy\Models\Udalost\DruhUdalosti[]
     */
    public array $zoznam;

    /**
     * @throws \ReflectionException
     */
    public function mount(): void
    {
        $this->zoznam = DruhUdalosti::toArray();
    }
    
    /**
     * @return \Illuminate\Contracts\View\View
     * @throws \Illuminate\Contracts\Container\BindingResolutionException
     */
    public function render(): View
    {
        return view('Terminy::components.livewire.udalosti.druh');
    }

    /**
     * @return \Seka\Terminy\Models\Udalost\DruhUdalosti[]
     */
    public function zoznam(): array
    {
        return $this->zoznam;
    }
}
