<div wire:ignore.self class="modal fade" tabindex="-1" role="dialog" id="theModal-CP">
    <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_CP_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-12">
                        <div class="form-group">
                            <label>Plan</label>
                            <select wire:model.lazy="plan_id" class="form-select">
                                <option value="">Seleccione una opción</option>
                                @foreach ($plans as $plan)
                                    <option value="{{ $plan->id }}">{{ $plan->name }}</option>
                                @endforeach
                            </select>
                            @error('plan_id')

                                <span class="text-danger err">{{ $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_CP_id < 1)
                    <button type="button" class="btn btn-primary close-modal"
                        wire:click.prevent="StoreCP()">GUARDAR</button>
                @else
                    <button type="button" class="btn btn-primary close-modal"
                        wire:click.prevent="UpdateCP()">ACTUALIZAR</button>
                @endif
            </div>
        </div><!-- modal-content -->
    </div>
</div>
