<div wire:ignore.self class="modal fade" tabindex="-1" role="dialog" id="theModal-TR">
    <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_TR_id > 0 ? 'EDITAR' : 'CREAR' }}
                </h5>
                <h6 class="text-center text-warning" wire:loading>ESPERE UN MOMENTO POR FAVOR</h6>
            </div>
            <div class="modal-body">
                <div class="row">
                    <div class="col-sm-6 col-md-5">
                        <div class="form-group">
                            <label>Empresa de la capacitación</label>
                            <input type="text" wire:model.lazy="company" class="form-control" placeholder="ej: Platzy"
                                maxlength="99">
                            @error('company')
                                <span class="text-danger er">{{ $message }}</span>
                            @enderror
                        </div>
                    </div>
                    <div class="col-sm-6 col-md-5">
                        <div class="form-group">
                            <label>Nombre de la capacitación</label>
                            <input type="text" wire:model.lazy="name" class="form-control" placeholder="ej: Ingles B1"
                                maxlength="99">
                            @error('name')
                                <span class="text-danger er">{{ $message }}</span>
                            @enderror
                        </div>
                    </div>
                    <div class="col-sm-12 col-md-5">
                        <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'); $i >= date('Y') - 100; $i--)
                                    <option value="{{ $i }}">{{ $i }}</option>
                                @endfor
                            </select>
                            @error('year')
                                <span class="text-danger er">{{ $message }}</span>
                            @enderror
                        </div>
                    </div>
                    <div class="col-sm-6 col-md-5">
                        <div class="form-group">
                            <label>Tiempos de la Capacitación</label>
                            <input type="text" wire:model.lazy="time" class="form-control"
                                placeholder="ej: 6 meses o 2 años y un mes" maxlength="99">
                            @error('time')
                                <span class="text-danger er">{{ $message }}</span>
                            @enderror
                        </div>
                    </div>
                    <div class="col-sm-6 col-md-5">
                        <div class="form-group">
                            <label>Lugar de Capacitación</label>
                            <input type="text" wire:model.lazy="place" class="form-control" placeholder="ej: Sitio"
                                maxlength="99">
                            @error('place')
                                <span class="text-danger er">{{ $message }}</span>
                            @enderror
                        </div>
                    </div>
                </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_TR_id < 1)
                    <button type="button" class="btn btn-primary close-modal"
                        wire:click.prevent="StoreTR()">GUARDAR</button>
                @else
                    <button type="button" class="btn btn-primary close-modal"
                        wire:click.prevent="UpdateTR()">ACTUALIZAR</button>
                @endif
            </div>
        </div><!-- modal-content -->
    </div>
</div>
