<?php

declare(strict_types=1);

namespace Seka\Vzdelavanie\Livewire\Components;

use Illuminate\Contracts\View\View;
use Livewire\Component;

/**
 * Class SearchText
 *
 * @package Seka\Vzdelavanie\Livewire\Components
 */
final class SearchText extends Component
{
    public ?string $searchText = null;

    /**
     * @return \Illuminate\Contracts\View\View
     * @throws \Illuminate\Contracts\Container\BindingResolutionException
     */
    public function render(): View
    {
        return view('Vzdelavanie::livewire.components.searchtext');
    }

    public function updatedSearchText(?string $value = null): void
    {
        $this->dispatch('filterByText', $value);
    }
}
