<?php

namespace App\Livewire\Components;

use Livewire\Component;

class SearchBox extends Component
{
    public string $search = '';
    public string $placeholder = 'Buscar...';
    public int $debounce = 300;

    public function updatedSearch()
    {
        $this->dispatch('searchUpdated', $this->search);
    }

    public function clear()
    {
        $this->search = '';
        $this->dispatch('searchUpdated', '');
    }

    public function render()
    {
        return view('livewire.components.search-box');
    }
}

