<x-filament-panels::page>
    <form wire:submit.prevent="generateReport" class="space-y-4 max-w-xl">

        <div>
            <label for="fromDate" class="block font-medium text-sm text-gray-700">Desde</label>
            <input type="date" id="fromDate" wire:model.defer="fromDate"
                class="mt-1 block w-full rounded-md shadow-sm border-gray-300 focus:ring focus:ring-opacity-50" />
            @error('fromDate')
                <p class="text-red-600 text-sm">{{ $message }}</p>
            @enderror
        </div>

        <div>
            <label for="toDate" class="block font-medium text-sm text-gray-700">Hasta</label>
            <input type="date" id="toDate" wire:model.defer="toDate"
                class="mt-1 block w-full rounded-md shadow-sm border-gray-300 focus:ring focus:ring-opacity-50" />
            @error('toDate')
                <p class="text-red-600 text-sm">{{ $message }}</p>
            @enderror
        </div>

        <div>
            <label for="email" class="block font-medium text-sm text-gray-700">Correo electrónico</label>
            <input type="email" id="email" wire:model.defer="email"
                class="mt-1 block w-full rounded-md shadow-sm border-gray-300 focus:ring focus:ring-opacity-50"
                placeholder="Ingrese el correo electrónico" />
            @error('email')
                <p class="text-red-600 text-sm">{{ $message }}</p>
            @enderror
        </div>

        <x-filament::button type="submit">
            Enviar reporte por correo
        </x-filament::button>

        @if (session()->has('success'))
            <div class="text-green-600 font-semibold">{{ session('success') }}</div>
        @endif
    </form>
</x-filament-panels::page>
