@include('common.modalHead')
<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-9 col-md-4">
        <div class="form-group">
            <label>Contraseña</label>
            <div class="input-group">
                <input type="password" wire:model.lazy="password" class="form-control" id="password">
                <span class="input-group-text" id='i-pa' onClick="togglePassword('password', 'i-pa')">
                    <i class="fas fa-eye"></i>
                </span>
            </div>
            @error('password')
                <span class="text-danger er">{{ $message }}</span>
            @enderror
        </div>
    </div>
    <div class="col-3 col-md-2 d-flex align-items-center justify-content-center">
        <button wire:click="generatePassword" class="btn btn-sm btn-primary">
            <i class="fas fa-key"></i>
        </button>
    </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>Asignar Rol</label>
            @if (auth()->user()->id != $selected_id)
            <select wire:model.lazy="role" class="form-select">
                <option value="">Seleccionar</option>
                @foreach ($roles as $rol)
                    <option value="{{$rol}}">{{$rol}}</option>
                @endforeach
            </select>
            @else
                <input type="text" wire:model.lazy="role" class="form-control" value="{{ $role }}" disabled>
            @endif
            @error('role')
                <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 class="col-sm-12 col-md-6">
        <div class="form-group">
            <label>Empresa Asignada</label><br>
            <p class="fs-5">{{ $company_user }}</p>
        </div>
    </div>

    <div class="col-12">
        <div class="form-group">
            <input type="checkbox" wire:model.lazy="send_mail"
                class="m-2 checkbox_animated" id="send_mail"
                title="Enviar datos de acceso"> <span class="small text-muted">Enviar email con datos de acceso al usuario</span>
        </div>
    </div>
</div>
@include('common.modalFooter')
