<div wire:ignore.self class="modal fade" tabindex="-1" role="dialog" id="theModal-PST">
    <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_PST_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_PST_id < 1)
                    <div class="col-sm-12 col-md-6">
                        <div class="form-group">
                            <label>Tipo de prueba Psico-técnica</label>
                            <select class="form-control form-select" wire:model.lazy="type_psychotechnics_test_id" name="type_psychotechnics_test_id">
                                <option value="Seleccionar">Seleccionar</option>
                                @foreach ($type_psychotechnics_tests as $type_psychotechnics_test)
                                    <option value="{{ $type_psychotechnics_test->id }}">{{ $type_psychotechnics_test->name }}</option>
                                @endforeach
                            </select>
                            @error('type_psychotechnics_test_id')
                                <span class="text-danger er">{{ $message }}</span>
                            @enderror
                        </div>
                    </div>
                    <div class="col-sm-12 col-md-6">
                        <div class="form-group">
                            <label>Soporte / resultado prueba</label>
                            <small class="text-muted">(Formatos: .jpg | .png | .pdf)</small>
                            <input type="file" wire:model="document_upload" class="form-control"
                                accept=".png, .jpg .pdf">
                            @if ($document_upload_view != null)
                                <a href="{{ asset('storage/users/'.$user_id.'/psychotechnics_test_supports/' . $document_upload_view) }}"
                                    target="_blank">Ver archivo</a>
                            @endif

                            @error('document_upload')
                                <span class="text-danger er">{{ $message }}</span>
                            @enderror
                        </div>
                    </div>
                    <div class="col-sm-12 col-md-12">
                        <div class="form-group">
                            <label>Observaciones</label>
                            <textarea class="form-control" wire:model.lazy="observations" name="observations" rows="3" maxlength="255"></textarea>
                            @error('observations')
                                <span class="text-danger er">{{ $message }}</span>
                            @enderror
                        </div>
                    </div>
                @else
                    <div class="col-sm-12-col-md-6">
                        <div class="form-group">
                            <label>Tipo de prueba Psico-técnica</label><br>
                            <h5>{{ $type_psychotechnics_test_name }}</h5>
                        </div>
                    </div>
                    <div class="col-sm-12 col-md-6">
                        <div class="form-group">
                            <label>Obervaciones</label><br>
                            <p>{{ $observations }}</p>
                        </div>
                    </div>
                    <div class="col-sm-12 col-md-12">
                        <div class="form-group">
                            <label>Soporte / resultado prueba</label><br>
                            <img src="{{ asset('storage/users/'.$user_id.'/psychotechnics_test_supports/' . $document_upload_view) }}" alt="Resultado prueba" 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_PST_id < 1)
                    <button type="button" class="btn btn-primary close-modal"
                        wire:click.prevent="StorePST()">GUARDAR</button>
                @endif
            </div>
        </div><!-- modal-content -->

    </div>
</div>

