<div  >
   
    
    <form wire:submit.prevent="import">
       
        <input type="hidden" wire:model="mapfile_id" value='{{$ballotingFile->name}}'>
        <button type="submit">Import</button>
    </form>

    <div wire:loading wire:target="import" wire:model="progress">
        Importing... {{ $progress }}%
        <div class="progress">
            <div class="progress-bar" role="progressbar" style="width: {{ $progress }}%;" aria-valuenow="{{ $progress }}" aria-valuemin="0" aria-valuemax="100"></div>
        </div>
    </div>
</div>

@push('scripts')
<script>
    
      document.addEventListener('DOMContentLoaded', function () {
            Livewire.on('show-swal', function (options) {
                console.log('sdfdaf');
        })
    });
     
//     document.addEventListener('DOMContentLoaded', () => {

// Livewire.on('reportFilterUpdated', _ => {
//     console.log('event listened');
// });

// });
// document.addEventListener('livewire:load', function () {
//       // Listen for the reportFilterUpdated event and refresh the component
//       Livewire.on('reportFilterUpdated', function () {
//         console.log('tttt');
//       });
//     });
    // Livewire.on('importProgressUpdate', (progress) => {
       
    //     console.log('test');
    //     // window.livewire.emit('updateProgress', progress);
    // });
//     Livewire.on('postAdded', postId => {
//     alert('A post was added with the id of: ' + postId);
// })
</script>
@endpush