<div wire:ignore.self class="modal fade" tabindex="-1" role="dialog" id="theModal-PV">
    <div class="modal-dialog modal-lg" role="document">
        <div class="modal-content">
            <div class="modal-header bg-primary">
                <h5 class="modal-title">
                    <b>{{ $componentName }}</b> | {{ $selected_PV_id > 0 ? 'VER' : 'CREAR' }}
                </h5>
                <h6 class="text-center text-warning" wire:loading>ESPERE UN MOMENTO POR FAVOR</h6>
            </div>
            <div class="modal-body">
                <div class="row">
                @if ($selected_PV_id < 1)
                    <div class="col-sm-12 col-md-6">
                        <div class="form-group">
                            <label>Soporte de pago</label>
                            <small class="text-muted">(Formatos: .jpg | .png | .pdf)</small>
                            <input type="file" wire:model="support_document" class="form-control"
                                accept=".png, .jpg .pdf">

                            @error('document_upload')
                                <span class="text-danger er">{{ $message }}</span>
                            @enderror
                        </div>
                    </div>
                    <div class="col-sm-12 col-md-3">
                        <div class="form-group">
                            <label>Año</label>
                            <select class="form-control form-select" wire:model.lazy="year" name="year">
                                <option value="Seleccionar">Seleccionar</option>
                                @for ($i = date('Y')-1; $i <= date('Y')+1; $i++)
                                    <option value="{{ $i }}">{{ $i }}</option>
                                @endfor
                            </select>
                            @error('year')
                                <span class="text-danger er">{{ $message }}</span>
                            @enderror
                        </div>
                    </div>
                    <div class="col-sm-12 col-md-3">
                        <div class="form-group">
                            <label>Mes</label>
                            <select class="form-control form-select" wire:model.lazy="month" name="month">
                                <option value="Seleccionar">Seleccionar</option>
                                @foreach (DataTypeMonth() as $key => $value)
                                    <option value="{{ $key }}">{{ $value }}</option>
                                @endforeach
                            </select>
                            @error('month')
                                <span class="text-danger er">{{ $message }}</span>
                            @enderror
                        </div>
                    </div>
                @else
                    <div class="col-sm-12 col-md-3">
                        <div class="form-group">
                            <label>Año</label><br>
                            <h5>{{ $year }}</h5>
                        </div>
                    </div>
                    <div class="col-sm-12 col-md-3">
                        <div class="form-group">
                            <label>Mes</label><br>
                            <p>{{ $month }}</p>
                        </div>
                    </div>
                    <div class="col-sm-12 col-md-12">
                        <div class="form-group">
                            <label>Soporte de pago</label><br>
                            <img src="{{ asset('storage/users/'.$user_id.'/payment_vouchers/' . $support_document_view) }}" alt="desprendible de pago" class="img-fluid">
                        </div>
                    </div>
                @endif
                </div><!-- row -->
            </div><!-- modal-body -->
            <div class="modal-footer">
                <button type="button" class="btn btn-outline-primary" wire:click.prevent="resetUI()"
                    data-bs-dismiss="modal">CERRAR</button>

                @if ($selected_PV_id < 1)
                    <button type="button" class="btn btn-primary close-modal"
                        wire:click.prevent="StorePV()">GUARDAR</button>
                @endif
            </div>
        </div><!-- modal-content -->

    </div>
</div>

