{{-- resources/views/filament/resources/venta-resource/pages/list-ventas.blade.php --}}
<x-filament::resources.pages.list-records :resource="$this->getResource()" :records="$this->getRecords()">
    @parent

    <script>
        window.addEventListener('imprimir-recibo', event => {
            const ventaId = event.detail.venta_id;
            const printWindow = window.open(`/imprimir-recibo/${ventaId}`, '_blank', 'width=300,height=600');
            if (printWindow) {
                printWindow.focus();
            } else {
                alert('Por favor, permite las ventanas emergentes para esta página.');
            }
        });
    </script>
</x-filament::resources.pages.list-records>
