<div>
    @section('title', $pageTitle)
    <div class="col">
        <x-empresa.form pageTitle="{{ $pageTitle }}" uuid="{{ $uuid }}">
            @if(!str_contains(request()->route()->uri(), 'edit'))
                <x-slot name="toolbar">
                    <button type="button" class="btn btn-outline-info rounded" title="Cargar Persona" data-bs-toggle="modal"
                        data-bs-target="#searchEmpresaModal">
                        <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" height="24" width="24">
                            <path d="M1.5 23.25L1.5 8.25 10.5 8.25 10.5 23.25" fill="none" stroke="currentColor"
                                stroke-linecap="round" stroke-linejoin="round" stroke-width="1" />
                            <path d="M4.5 23.25L4.5 11.25" fill="none" stroke="currentColor" stroke-linecap="round"
                                stroke-linejoin="round" stroke-width="1" />
                            <path d="M7.5 23.25L7.5 11.25" fill="none" stroke="currentColor" stroke-linecap="round"
                                stroke-linejoin="round" stroke-width="1" />
                            <path d="M1.5 8.25L6 3 10.5 8.25" fill="none" stroke="currentColor"
                                stroke-linecap="round" stroke-linejoin="round" stroke-width="1" />
                            <path d="M6 0.75L6 3" fill="none" stroke="currentColor" stroke-linecap="round"
                                stroke-linejoin="round" stroke-width="1" />
                            <path d="M22.5,23.25V11.041a.751.751,0,0,0-.513-.712l-7.5-2.5a.749.749,0,0,0-.987.712V23.25"
                                fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"
                                stroke-width="1" />
                            <path d="M19.5 21L19.5 21.75" fill="none" stroke="currentColor" stroke-linecap="round"
                                stroke-linejoin="round" stroke-width="1" />
                            <path d="M19.5 17.25L19.5 18" fill="none" stroke="currentColor" stroke-linecap="round"
                                stroke-linejoin="round" stroke-width="1" />
                            <path d="M19.5 13.5L19.5 14.25" fill="none" stroke="currentColor" stroke-linecap="round"
                                stroke-linejoin="round" stroke-width="1" />
                            <path d="M16.5 21L16.5 21.75" fill="none" stroke="currentColor" stroke-linecap="round"
                                stroke-linejoin="round" stroke-width="1" />
                            <path d="M16.5 17.25L16.5 18" fill="none" stroke="currentColor" stroke-linecap="round"
                                stroke-linejoin="round" stroke-width="1" />
                            <path d="M16.5 13.5L16.5 14.25" fill="none" stroke="currentColor" stroke-linecap="round"
                                stroke-linejoin="round" stroke-width="1" />
                        </svg>
                    </button>
                    <div wire:ignore.self class="modal fade" id="searchEmpresaModal" tabindex="-1"
                        aria-labelledby="searchEmpresaModalLabel" aria-hidden="true">
                        <div class="modal-dialog">
                            <div class="modal-content">
                                <form>
                                    <div class="modal-header">
                                        <h3 class="modal-title" id="searchEmpresaModalLabel">Cargar Empresa</h3>
                                        <button
                                            x-on:hide-modal.window="document.getElementById('btn-close-modal-register').click();"
                                            id="btn-close-modal-register" type="button" class="btn-close"
                                            data-bs-dismiss="modal" aria-label="Close"></button>
                                    </div>
                                    <div class="modal-body">
                                        <div class="col">
                                            <!-- Card -->
                                            <div class="border-0 scroll-mt-3">
                                                <label class="form-label" for="">Buscar Empresa</label>
                                                <input type="text" class="form-control"
                                                    wire:model.live.debounce.150ms="empresaSearch" list="empresas">
                                                <datalist id="empresas">
                                                    @foreach ($empresasResult as $empresa)
                                                        <option value="{{ $empresa->razon }}">{{ $empresa->rif }}
                                                        </option>
                                                    @endforeach
                                                </datalist>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="modal-footer d-flex justify-content-end">
                                        <!-- Button -->
                                        <button type="button" wire:click="cargarEmpresa" class="btn btn-primary">Cargar</button>
                                    </div>
                                </form>
                            </div>
                        </div>
                    </div>
                </x-slot>
            @endif
        </x-empresa.form>
    </div>

</div>
