<div wire:ignore.self class="modal fade" tabindex="-1" role="dialog" id="theModal">
    <div class="modal-dialog modal-lg" role="document">
        <div class="modal-content">
            <div class="modal-header bg-primary">
                <h5 class="modal-title">
                <b>EMPLEADO</b> | {{ $selected_user_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-12 col-md-6">
                        <div class="form-group">
                            <label>Nombre</label>
                            <input type="text" wire:model.lazy="first_name" class="form-control" placeholder="ej: Mauricio" maxlength="99">
                            @error('first_name')
                                <span class="text-danger er">{{ $message }}</span>
                            @enderror
                        </div>
                    </div>
                    <div class="col-sm-12 col-md-6">
                        <div class="form-group">
                            <label>Apellido</label>
                            <input type="text" wire:model.lazy="last_name" class="form-control" placeholder="ej:García" maxlength="99">
                            @error('last_name')
                                <span class="text-danger er">{{ $message }}</span>
                            @enderror
                        </div>
                    </div>
                    <div class="col-sm-12 col-md-6">
                        <div class="form-group">
                            <label>Documento</label>
                            <input type="text" wire:model.lazy="document" class="form-control" placeholder="ej: 111055698" maxlength="15">
                            @error('document')
                                <span class="text-danger er">{{ $message }}</span>
                            @enderror
                        </div>
                    </div>
                    <div class="col-sm-12 col-md-6">
                        <div class="form-group">
                            <label>Teléfono</label>
                            <input type="text" wire:model.lazy="phone" class="form-control" placeholder="ej: 3202568745" maxlength="15">
                            @error('phone')
                                <span class="text-danger er">{{ $message }}</span>
                            @enderror
                        </div>
                    </div>
                    <div class="col-sm-12 col-md-6">
                        <div class="form-group">
                            <label>Email</label>
                            <input type="text" wire:model.lazy="email" class="form-control" placeholder="ej: mg-net@hotmail.com" maxlength="99">
                            @error('email')
                                <span class="text-danger er">{{ $message }}</span>
                            @enderror
                        </div>
                    </div>
                    <div class="col-sm-12 col-md-6">
                        <div class="form-group">
                            <label>Contraseña</label>
                            <input type="password" wire:model.lazy="password" class="form-control">
                            @error('password')
                                <span class="text-danger er">{{ $message }}</span>
                            @enderror
                        </div>
                    </div>
                    <div class="col-sm-12 col-md-6">
                        <div class="form-group">
                            <label>Estado</label>
                            <select wire:model.lazy="status" class="form-select">
                                <option value="">Seleccionar</option>
                                <option value="ACTIVO">Activo</option>
                                <option value="INACTIVO">Inactivo</option>
                            </select>
                            @error('status')
                                <span class="text-danger er">{{ $message }}</span>
                            @enderror
                        </div>
                    </div>
                    <div class="col-sm-12 col-md-6">
                        <div class="form-group">
                            <label>Imagen de Perfil</label>
                            <input type="file" wire:model="image" class="form-control" accept=".png, .jpg">
                            @error('image')
                                <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_user_id < 1 )
                    <button type="button" class="btn btn-primary close-modal" wire:click.prevent="Store()">GUARDAR</button>
                @else
                    <button type="button" class="btn btn-primary close-modal" wire:click.prevent="Update()">ACTUALIZAR</button>
                @endif
            </div><!-- modal-footer -->
        </div><!-- modal-content -->
    </div>
</div>

