<div wire:ignore.self class="modal fade" tabindex="-1" role="dialog" id="theModalWorkCertificate" data-bs-focus="false">
    <div class="modal-dialog modal-xl" role="document">
        <div class="modal-content">
            <div class="modal-header bg-primary">
                <h5 class="modal-title">
                <b>Solicitud</b> |
                @if  ($work_certificate_id > 0)
                    {{ $first_name }} {{ $last_name }}

                @endif
                </h5>
                <h6 class="text-center text-warning" wire:loading>ESPERE UN MOMENTO POR FAVOR</h6>
            </div>
        <div class="modal-body">
            <span class="b-r-4 m-t-5 m-r-0 py-1 px-2 top-0 end-0 p-absolute m-r-5 {{ $status == 0 ? 'bg-warning' : ($status == 1 ? 'bg-success' : 'bg-danger') }}">
                {{ DataTypeStatusStandard($status) }}
                <i class="fas {{ $status == 0 ? 'fa-clock' : ($status == 1 ? 'fa-check' : 'fa-times') }}"></i>
            </span>
            <span class="b-r-4 m-t-5 m-r-5 py-1 px-2 top-0 start-0 p-absolute">
                <i class="fas fa-calendar-alt"></i>
                {{ \Carbon\Carbon::parse($solicitation_date)->day }} de
                {{ \Carbon\Carbon::parse($solicitation_date)->monthName }} de
                {{ \Carbon\Carbon::parse($solicitation_date)->year }}
            </span>
            <div class="row m-t-30">
                <div class="col-sm-12 col-md-12">
                    <p class="display-6 text-center">
                        <span class="f-w-700"> CERTIFICADO LABORAL </span>
                    </p>
                    <h5 class="f-w-300 text-center">{{ $requested_to}} </h5>
                    @if ($status != 0)
                        <hr class="m-t-30">
                        <label class="fs-6"><span class="f-w-700"><span> {{ DataTypeStatusStandard($status) }} por {{ FullNameUser($reviewed_by) }}</label>
                        @if ($status == 2)
                            <br>
                            <label class="fs-6"><span class="f-w-700">Motivo de rechazo:<span> {{ $rejected_reason == NULL ? 'No hay motivo de rechazo' : $rejected_reason }} </label>
                        @elseif ($status == 1)
                            @can('Company_work_certificate_download')
                                <p class="m-t-50">
                                <a href="{{ url('descargar/certificado/' .$work_certificate_id) }}" target="_blank" class="btn btn-square btn-outline-primary btn-sm b-r-4 m-t-5 m-r-5 py-1 px-2">
                                    Descargar Certificado <i class="fas fa-download"></i>
                                </a>
                                </p>
                            @endcan
                        @endif

                    @endif
                </div>
            </div><!-- row -->


        </div><!-- modal-body -->
        @include('livewire.loading.component') <!--- component loading ,en targetLoading se coloca el nombre del metodo que se esta cargando --->
        <div class="modal-footer">
            <button type="button" class="btn btn-outline-primary" wire:click.prevent="resetUIWC()" data-bs-dismiss="modal">CERRAR</button>
            @if( $work_certificate_id > 0 && $status == 0)
                <button
                    type="button"
                    class="btn btn-danger close-modal"
                    onclick="ConfirmWorkCertificateAction('{{ $work_certificate_id }}', '2')">
                    RECHAZAR SOLICITUD <i class="fas fa-times"></i>
        </button>
                <button type="button"
                    class="btn btn-success close-modal" onclick="ConfirmWorkCertificateAction({{ $work_certificate_id }},'1')">
                    APROBAR SOLICITUD <i class="fas fa-check"></i>
                </button>
            @endif
        </div>
    </div>
</div>
</div>

