<div wire:ignore.self class="modal fade" tabindex="-1" role="dialog" id="theModal">
    <div class="modal-dialog modal-xl" role="document">
        <div class="modal-content">
            <div class="modal-header bg-primary">
                <h5 class="modal-title">
                <b>{{ $componentName }}</b> | {{ $selected_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-8">
                    <div class="form-group">
                        <label>Nombre</label>
                        <input type="text" wire:model.lazy="name" class="form-control" placeholder="ej: Auxiliar de contabilidad" maxlength="99">
                        @error('name')
                            <span class="text-danger er">{{ $message }}</span>
                        @enderror
                    </div>
                </div>
                <div class="col-sm-12 col-md-4">
                    <div class="form-group">
                        <label>Salario base</label>
                        <input type="text" data-type="currency" wire:model.lazy="base_salary" class="form-control" placeholder="ej: 1.000.000.00" maxlength="13">
                        @error('base_salary')
                            <span class="text-danger er">{{ $message }}</span>
                        @enderror
                    </div>
                </div>

                <div class="col-sm-12 col-md-12">
                    <div class="form-group">
                        <label>Funciones principales</label>
                        <div id="main_functions_container" wire:ignore>
                            <textarea id="main_functions" data-main_functions="@this" class="form-control" placeholder="ej: Realizar las contabilizaciones de los activos y pasivos" wire:model.debounce.9999999ms="main_functions" rows="5">{!! $main_functions !!}</textarea>
                        </div>
                        @error('main_functions')
                            <span class="text-danger er">{{ $message }}</span>
                        @enderror
                    </div>
                </div>
                <div class="col-sm-12 col-md-6">
                    <div class="form-group">
                        <label>Funciones Especiales</label>
                        <div id="special_functions_container" wire:ignore>
                            <textarea id="special_functions" data-special_functions="@this" class="form-control" placeholder="ej: Elaborar los balances de caja y banco" wire:model.lazy="special_functions" rows="5">{!! $special_functions !!}</textarea>
                        </div>
                        @error('special_functions')
                            <span class="text-danger er">{{ $message }}</span>
                        @enderror
                    </div>
                </div>
                <div class="col-sm-12 col-md-6">
                    <div class="form-group">
                        <label>Cualidades</label>
                        <div id="qualities_container" wire:ignore>
                            <textarea id="qualities" data-qualities="@this" class="form-control" placeholder="ej: Capacidad de análisis" wire:model.lazy="qualities" rows="5">{!! $qualities !!}</textarea>
                        </div>
                        @error('qualities')
                            <span class="text-danger er">{{ $message }}</span>
                        @enderror
                    </div>
                </div>

            </div>
        </div>
        <div class="modal-footer">
            <button type="button" class="btn btn-outline-primary" wire:click.prevent="resetUI()" data-bs-dismiss="modal">CERRAR</button>
            @if( $selected_id < 1 )
                <button id="save_job_position" type="button" class="btn btn-primary close-modal" wire:click.prevent="Store()">GUARDAR</button>
            @else
                <button id="save_job_position" type="button" class="btn btn-primary close-modal" wire:click.prevent="Update()">ACTUALIZAR</button>
            @endif
        </div>
    </div>
</div>
</div>


