<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: Modificación de Salario">
                        @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>Estado</label>
                        <select wire:model.lazy="status" class="form-control">
                            <option value="">Seleccione...</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-8">
                    <div class="form-group">
                        <label>Descripción</label>
                        <textarea wire:model.lazy="description" class="form-control" placeholder="ej: Anexo de Modificación de Salario" rows="3"></textarea>
                        @error('description')
                            <span class="text-danger er">{{ $message }}</span>
                        @enderror
                    </div>
                </div>

                <div class="col-sm-12 col-md-12">
                    <div class="form-group">
                        <label>Contenido Anexo</label>
                        <div id="content_container" wire:ignore>
                            <textarea id="content" data-content="@this" class="form-control"  wire:model.debounce.9999999ms="content" rows="5">{!! $content !!}</textarea>
                        </div>
                        @error('content')
                            <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_annex_others" type="button" class="btn btn-primary close-modal" wire:click.prevent="Store()">GUARDAR</button>
            @else
                <button id="save_annex_others" type="button" class="btn btn-primary close-modal" wire:click.prevent="Update()">ACTUALIZAR</button>
            @endif
        </div>
    </div>
</div>
</div>


