@extends('layouts.admin.theme')
@section('title', env('APP_NAME') . ' :: ' . __('Parque Tecnológico'))
@section('content')
    @include('errors.messageFlash')

    <div class="card shadow-sm border-0">
        @php $headLine = "<i class='fa-solid fa-flask'></i> " . __('Parque Tecnológico'); @endphp
        <div class="card-header bg-primary border-0 pb-0">
            @include('components.buttons._headLineButtonsBackAdd', [
                'headLine' => $headLine,
                'routeBack' => 'admin.dashboard',
                'nameBack' => __('Voltar'),
            ])
        </div>

        <div class="card-body">
            <ul class="nav nav-tabs nav-fill small border-bottom mb-4" id="parqueTecTab" role="tablist">
                <li class="nav-item" role="presentation">
                    <button class="nav-link {{ $activeTab === 'editais' ? 'active' : '' }}" id="editais-tab" data-bs-toggle="tab" data-bs-target="#editais-pane" type="button" role="tab" aria-controls="editais-pane" aria-selected="{{ $activeTab === 'editais' ? 'true' : 'false' }}">
                        <span class="d-flex align-items-center justify-content-center">
                            <i class="fa-solid fa-file-lines me-2"></i>
                            <span>{{ __('Editais') }}</span>
                        </span>
                    </button>
                </li>
                <li class="nav-item" role="presentation">
                    <button class="nav-link {{ $activeTab === 'decretos' ? 'active' : '' }}" id="decretos-tab" data-bs-toggle="tab" data-bs-target="#decretos-pane" type="button" role="tab" aria-controls="decretos-pane" aria-selected="{{ $activeTab === 'decretos' ? 'true' : 'false' }}">
                        <span class="d-flex align-items-center justify-content-center">
                            <i class="fa-solid fa-scale-balanced me-2"></i>
                            <span>{{ __('Decretos e Leis') }}</span>
                        </span>
                    </button>
                </li>
                <li class="nav-item" role="presentation">
                    <button class="nav-link {{ $activeTab === 'areas' ? 'active' : '' }}" id="areas-tab" data-bs-toggle="tab" data-bs-target="#areas-pane" type="button" role="tab" aria-controls="areas-pane" aria-selected="{{ $activeTab === 'areas' ? 'true' : 'false' }}">
                        <span class="d-flex align-items-center justify-content-center">
                            <i class="fa-solid fa-layer-group me-2"></i>
                            <span>{{ __('Áreas') }}</span>
                        </span>
                    </button>
                </li>
                <li class="nav-item" role="presentation">
                    <button class="nav-link {{ $activeTab === 'faqs' ? 'active' : '' }}" id="faqs-tab" data-bs-toggle="tab" data-bs-target="#faqs-pane" type="button" role="tab" aria-controls="faqs-pane" aria-selected="{{ $activeTab === 'faqs' ? 'true' : 'false' }}">
                        <span class="d-flex align-items-center justify-content-center">
                            <i class="fa-solid fa-circle-question me-2"></i>
                            <span>{{ __('Perguntas Frequentes') }}</span>
                        </span>
                    </button>
                </li>
                <li class="nav-item" role="presentation">
                    <button class="nav-link {{ $activeTab === 'startups' ? 'active' : '' }}" id="startups-tab" data-bs-toggle="tab" data-bs-target="#startups-pane" type="button" role="tab" aria-controls="startups-pane" aria-selected="{{ $activeTab === 'startups' ? 'true' : 'false' }}">
                        <span class="d-flex align-items-center justify-content-center">
                            <i class="fa-solid fa-lightbulb me-2"></i>
                            <span>{{ __('Startups') }}</span>
                        </span>
                    </button>
                </li>
            </ul>

            <div class="tab-content" id="parqueTecTabContent">
                {{-- Aba Editais --}}
                <div class="tab-pane fade {{ $activeTab === 'editais' ? 'show active' : '' }}" id="editais-pane" role="tabpanel" aria-labelledby="editais-tab">
                    <div class="d-flex flex-column flex-lg-row align-items-lg-center justify-content-lg-between mb-3 gap-2">
                        <form class="d-flex flex-grow-1" method="get">
                            <input type="hidden" name="tab" value="editais">
                            <input type="hidden" name="page_editais" value="1">
                            <input type="hidden" name="q_decretos" value="{{ request('q_decretos') }}">
                            <input type="hidden" name="page_decretos" value="{{ request('page_decretos', 1) }}">
                            <input type="text" class="form-control me-2" name="q_editais" placeholder="{{ __('Pesquisar por título ou descrição...') }}" value="{{ request('q_editais') }}">
                            <button class="btn btn-outline-success" type="submit" title="{{ __('Pesquisar') }}">
                                <i class="fa-solid fa-magnifying-glass"></i>
                            </button>
                        </form>

                        <div class="text-lg-end">
                            @if (auth()->user()->getPermissaoDetalhes('GERENCIADOR_DE_PARQUE_TECNOLOGICO')['adicionar'])
                                <a href="{{ route('admin.parqueTecnologico.editais.create') }}" class="btn btn-sm btn-success">
                                    <i class="fa-solid fa-plus me-1"></i> {{ __('Novo Edital') }}
                                </a>
                            @endif
                        </div>
                    </div>

                    <div class="table-responsive">
                        <table class="table table-bordered table-hover table-striped align-middle text-center mb-0">
                            @include('components.tables._thead', ['thead' => [__('Título'), __('Data publicação'), __('Status'), __('Ações')]])
                            <tbody>
                                @php $index = 0; @endphp
                                @forelse($editais as $edital)
                                    <tr>
                                        <td class="text-start">{{ Str::limit($edital->titulo, 80) }}</td>
                                        <td>{{ $edital->data_publicacao?->format('d/m/Y') ?? '–' }}</td>
                                        <td class="text-center align-middle">
                                            @include('components.buttons._status', [
                                                'index' => $index,
                                                'idPrefix' => 'editais',
                                                'route' => 'admin.parqueTecnologico.editais.status',
                                                'id' => $edital->id,
                                                'status' => $edital->status,
                                                'permission' => 'GERENCIADOR_DE_PARQUE_TECNOLOGICO',
                                                'queryParams' => [
                                                    'tab' => 'editais',
                                                    'page_editais' => request('page_editais', 1),
                                                    'page_decretos' => request('page_decretos', 1),
                                                    'q_editais' => request('q_editais'),
                                                    'q_decretos' => request('q_decretos'),
                                                ],
                                            ])
                                        </td>
                                        <td class="text-nowrap text-center align-middle">
                                            <div class="btn-group" role="group">
                                                <a href="{{ route('admin.parqueTecnologico.editais.edit', $edital->id) }}" class="btn btn-sm btn-warning" title="{{ __('Editar') }}">
                                                    <i class="fa-solid fa-pen-to-square"></i>
                                                </a>
                                                @if (auth()->user()->getPermissaoDetalhes('GERENCIADOR_DE_PARQUE_TECNOLOGICO')['excluir'])
                                                    <form class="d-inline" action="{{ route('admin.parqueTecnologico.editais.destroy', $edital->id) }}" method="post" onsubmit="return confirmDelete(this)">
                                                        @csrf
                                                        @method('delete')
                                                        <input type="hidden" name="confirm" value="{{ __('Este edital será excluído. Deseja continuar?') }}">
                                                        <button type="submit" class="btn btn-sm btn-danger" title="{{ __('Excluir') }}">
                                                            <i class="fa-solid fa-trash"></i>
                                                        </button>
                                                    </form>
                                                @endif
                                            </div>
                                        </td>
                                    </tr>
                                    @php $index++; @endphp
                                @empty
                                    <tr>
                                        <td colspan="4" class="text-muted fst-italic">{{ __('Nenhum edital encontrado.') }}</td>
                                    </tr>
                                @endforelse
                            </tbody>
                        </table>
                    </div>
                    <div class="d-flex justify-content-center mt-3">
                        {!! $editais->appends(['tab' => 'editais', 'q_editais' => request('q_editais'), 'q_decretos' => request('q_decretos'), 'page_decretos' => request('page_decretos', 1)])->links() !!}
                    </div>
                </div>

                {{-- Aba Decretos e Leis --}}
                <div class="tab-pane fade {{ $activeTab === 'decretos' ? 'show active' : '' }}" id="decretos-pane" role="tabpanel" aria-labelledby="decretos-tab">
                    <div class="d-flex flex-column flex-lg-row align-items-lg-center justify-content-lg-between mb-3 gap-2">
                        <form class="d-flex flex-grow-1" method="get">
                            <input type="hidden" name="tab" value="decretos">
                            <input type="hidden" name="q_editais" value="{{ request('q_editais') }}">
                            <input type="hidden" name="page_editais" value="{{ request('page_editais', 1) }}">
                            <input type="hidden" name="page_decretos" value="1">
                            <input type="text" class="form-control me-2" name="q_decretos" placeholder="{{ __('Pesquisar por título, descrição ou número...') }}" value="{{ request('q_decretos') }}">
                            <button class="btn btn-outline-success" type="submit" title="{{ __('Pesquisar') }}">
                                <i class="fa-solid fa-magnifying-glass"></i>
                            </button>
                        </form>

                        <div class="text-lg-end">
                            @if (auth()->user()->getPermissaoDetalhes('GERENCIADOR_DE_PARQUE_TECNOLOGICO')['adicionar'])
                                <a href="{{ route('admin.parqueTecnologico.decretosLeis.create') }}" class="btn btn-sm btn-success">
                                    <i class="fa-solid fa-plus me-1"></i> {{ __('Novo Decreto/Lei') }}
                                </a>
                            @endif
                        </div>
                    </div>

                    <div class="table-responsive">
                        <table class="table table-bordered table-hover table-striped align-middle text-center mb-0">
                            @include('components.tables._thead', ['thead' => [__('Título'), __('Número'), __('Data publicação'), __('Status'), __('Ações')]])
                            <tbody>
                                @php $index = 0; @endphp
                                @forelse($decretosLeis as $decretoLei)
                                    <tr>
                                        <td class="text-start">{{ Str::limit($decretoLei->titulo, 60) }}</td>
                                        <td>{{ $decretoLei->numero_lei ?? '–' }}</td>
                                        <td>{{ $decretoLei->data_publicacao?->format('d/m/Y') ?? '–' }}</td>
                                        <td class="text-center align-middle">
                                            @include('components.buttons._status', [
                                                'index' => $index,
                                                'idPrefix' => 'decretos',
                                                'route' => 'admin.parqueTecnologico.decretosLeis.status',
                                                'id' => $decretoLei->id,
                                                'status' => $decretoLei->status,
                                                'permission' => 'GERENCIADOR_DE_PARQUE_TECNOLOGICO',
                                                'queryParams' => [
                                                    'tab' => 'decretos',
                                                    'page_editais' => request('page_editais', 1),
                                                    'page_decretos' => request('page_decretos', 1),
                                                    'q_editais' => request('q_editais'),
                                                    'q_decretos' => request('q_decretos'),
                                                ],
                                            ])
                                        </td>
                                        <td class="text-nowrap text-center align-middle">
                                            <div class="btn-group" role="group">
                                                <a href="{{ route('admin.parqueTecnologico.decretosLeis.edit', $decretoLei->id) }}" class="btn btn-sm btn-warning" title="{{ __('Editar') }}">
                                                    <i class="fa-solid fa-pen-to-square"></i>
                                                </a>
                                                @if (auth()->user()->getPermissaoDetalhes('GERENCIADOR_DE_PARQUE_TECNOLOGICO')['excluir'])
                                                    <form class="d-inline" action="{{ route('admin.parqueTecnologico.decretosLeis.destroy', $decretoLei->id) }}" method="post" onsubmit="return confirmDelete(this)">
                                                        @csrf
                                                        @method('delete')
                                                        <input type="hidden" name="confirm" value="{{ __('Este decreto/lei será excluído. Deseja continuar?') }}">
                                                        <button type="submit" class="btn btn-sm btn-danger" title="{{ __('Excluir') }}">
                                                            <i class="fa-solid fa-trash"></i>
                                                        </button>
                                                    </form>
                                                @endif
                                            </div>
                                        </td>
                                    </tr>
                                    @php $index++; @endphp
                                @empty
                                    <tr>
                                        <td colspan="5" class="text-muted fst-italic">{{ __('Nenhum decreto/lei encontrado.') }}</td>
                                    </tr>
                                @endforelse
                            </tbody>
                        </table>
                    </div>
                    <div class="d-flex justify-content-center mt-3">
                        {!! $decretosLeis->appends(['tab' => 'decretos', 'q_editais' => request('q_editais'), 'page_editais' => request('page_editais', 1), 'q_decretos' => request('q_decretos')])->links() !!}
                    </div>
                </div>

                {{-- Aba Áreas --}}
                <div class="tab-pane fade {{ $activeTab === 'areas' ? 'show active' : '' }}" id="areas-pane" role="tabpanel" aria-labelledby="areas-tab">
                    <div class="d-flex flex-column flex-lg-row align-items-lg-center justify-content-lg-between mb-3 gap-2">
                        <form class="d-flex flex-grow-1" method="get">
                            <input type="hidden" name="tab" value="areas">
                            <input type="hidden" name="q_editais" value="{{ request('q_editais') }}">
                            <input type="hidden" name="page_editais" value="{{ request('page_editais', 1) }}">
                            <input type="hidden" name="q_decretos" value="{{ request('q_decretos') }}">
                            <input type="hidden" name="page_decretos" value="{{ request('page_decretos', 1) }}">
                            <input type="hidden" name="page_areas" value="1">
                            <input type="text" class="form-control me-2" name="q_areas" placeholder="{{ __('Pesquisar por título ou descrição...') }}" value="{{ request('q_areas') }}">
                            <button class="btn btn-outline-success" type="submit" title="{{ __('Pesquisar') }}">
                                <i class="fa-solid fa-magnifying-glass"></i>
                            </button>
                        </form>

                        <div class="text-lg-end">
                            @if (auth()->user()->getPermissaoDetalhes('GERENCIADOR_DE_PARQUE_TECNOLOGICO')['adicionar'])
                                <a href="{{ route('admin.parqueTecnologico.areas.create') }}" class="btn btn-sm btn-success">
                                    <i class="fa-solid fa-plus me-1"></i> {{ __('Nova área') }}
                                </a>
                            @endif
                        </div>
                    </div>

                    <div class="table-responsive">
                        <table class="table table-bordered table-hover table-striped align-middle text-center mb-0">
                            @include('components.tables._thead', ['thead' => [__('Título'), __('Ordem'), __('Status'), __('Ações')]])
                            <tbody>
                                @forelse($areas as $area)
                                    <tr>
                                        <td class="text-start">{{ Str::limit($area->titulo, 80) }}</td>
                                        <td>{{ $area->ordem }}</td>
                                        <td>
                                            <span class="badge {{ $area->status ? 'bg-success' : 'bg-secondary' }}">
                                                {{ $area->status ? __('Ativo') : __('Inativo') }}
                                            </span>
                                        </td>
                                        <td class="text-nowrap text-center align-middle">
                                            <div class="btn-group" role="group">
                                                <a href="{{ route('admin.parqueTecnologico.areas.edit', $area->id) }}" class="btn btn-sm btn-warning" title="{{ __('Editar') }}">
                                                    <i class="fa-solid fa-pen-to-square"></i>
                                                </a>
                                                @if (auth()->user()->getPermissaoDetalhes('GERENCIADOR_DE_PARQUE_TECNOLOGICO')['excluir'])
                                                    <form class="d-inline" action="{{ route('admin.parqueTecnologico.areas.destroy', $area->id) }}" method="post" onsubmit="return confirmDelete(this)">
                                                        @csrf
                                                        @method('delete')
                                                        <input type="hidden" name="confirm" value="{{ __('Esta área será excluída. Deseja continuar?') }}">
                                                        <button type="submit" class="btn btn-sm btn-danger" title="{{ __('Excluir') }}">
                                                            <i class="fa-solid fa-trash"></i>
                                                        </button>
                                                    </form>
                                                @endif
                                            </div>
                                        </td>
                                    </tr>
                                @empty
                                    <tr>
                                        <td colspan="4" class="text-muted fst-italic">{{ __('Nenhuma área cadastrada.') }}</td>
                                    </tr>
                                @endforelse
                            </tbody>
                        </table>
                    </div>
                    <div class="d-flex justify-content-center mt-3">
                        {!! $areas->appends([
                            'tab' => 'areas',
                            'q_editais' => request('q_editais'),
                            'page_editais' => request('page_editais', 1),
                            'q_decretos' => request('q_decretos'),
                            'page_decretos' => request('page_decretos', 1),
                            'q_areas' => request('q_areas'),
                        ])->links() !!}
                    </div>
                </div>

                {{-- Aba Perguntas Frequentes --}}
                <div class="tab-pane fade {{ $activeTab === 'faqs' ? 'show active' : '' }}" id="faqs-pane" role="tabpanel" aria-labelledby="faqs-tab">
                    <div class="d-flex flex-column flex-lg-row align-items-lg-center justify-content-lg-between mb-3 gap-2">
                        <form class="d-flex flex-grow-1" method="get">
                            <input type="hidden" name="tab" value="faqs">
                            <input type="hidden" name="q_editais" value="{{ request('q_editais') }}">
                            <input type="hidden" name="page_editais" value="{{ request('page_editais', 1) }}">
                            <input type="hidden" name="q_decretos" value="{{ request('q_decretos') }}">
                            <input type="hidden" name="page_decretos" value="{{ request('page_decretos', 1) }}">
                            <input type="hidden" name="q_areas" value="{{ request('q_areas') }}">
                            <input type="hidden" name="page_areas" value="{{ request('page_areas', 1) }}">
                            <input type="hidden" name="page_faqs" value="1">
                            <input type="text" class="form-control me-2" name="q_faqs" placeholder="{{ __('Pesquisar por pergunta ou resposta...') }}" value="{{ request('q_faqs') }}">
                            <button class="btn btn-outline-success" type="submit" title="{{ __('Pesquisar') }}">
                                <i class="fa-solid fa-magnifying-glass"></i>
                            </button>
                        </form>

                        <div class="text-lg-end">
                            @if (auth()->user()->getPermissaoDetalhes('GERENCIADOR_DE_PARQUE_TECNOLOGICO')['adicionar'])
                                <a href="{{ route('admin.parqueTecnologico.faqs.create') }}" class="btn btn-sm btn-success">
                                    <i class="fa-solid fa-plus me-1"></i> {{ __('Nova Pergunta') }}
                                </a>
                            @endif
                        </div>
                    </div>

                    <div class="table-responsive">
                        <table class="table table-bordered table-hover table-striped align-middle text-center mb-0">
                            @include('components.tables._thead', ['thead' => [__('Pergunta'), __('Ordem'), __('Status'), __('Ações')]])
                            <tbody>
                                @forelse($faqs as $faq)
                                    <tr>
                                        <td class="text-start">{{ \Illuminate\Support\Str::limit($faq->pergunta, 120) }}</td>
                                        <td>{{ $faq->ordem }}</td>
                                        <td>
                                            <span class="badge {{ $faq->status ? 'bg-success' : 'bg-secondary' }}">
                                                {{ $faq->status ? __('Ativo') : __('Inativo') }}
                                            </span>
                                        </td>
                                        <td class="text-nowrap text-center align-middle">
                                            <div class="btn-group" role="group">
                                                <a href="{{ route('admin.parqueTecnologico.faqs.edit', $faq->id) }}" class="btn btn-sm btn-warning" title="{{ __('Editar') }}">
                                                    <i class="fa-solid fa-pen-to-square"></i>
                                                </a>
                                                @if (auth()->user()->getPermissaoDetalhes('GERENCIADOR_DE_PARQUE_TECNOLOGICO')['excluir'])
                                                    <form class="d-inline" action="{{ route('admin.parqueTecnologico.faqs.destroy', $faq->id) }}" method="post" onsubmit="return confirmDelete(this)">
                                                        @csrf
                                                        @method('delete')
                                                        <input type="hidden" name="confirm" value="{{ __('Esta pergunta frequente será excluída. Deseja continuar?') }}">
                                                        <button type="submit" class="btn btn-sm btn-danger" title="{{ __('Excluir') }}">
                                                            <i class="fa-solid fa-trash"></i>
                                                        </button>
                                                    </form>
                                                @endif
                                            </div>
                                        </td>
                                    </tr>
                                @empty
                                    <tr>
                                        <td colspan="4" class="text-muted fst-italic">{{ __('Nenhuma pergunta frequente cadastrada.') }}</td>
                                    </tr>
                                @endforelse
                            </tbody>
                        </table>
                    </div>
                    <div class="d-flex justify-content-center mt-3">
                        {!! $faqs->appends([
                            'tab' => 'faqs',
                            'q_editais' => request('q_editais'),
                            'page_editais' => request('page_editais', 1),
                            'q_decretos' => request('q_decretos'),
                            'page_decretos' => request('page_decretos', 1),
                            'q_areas' => request('q_areas'),
                            'page_areas' => request('page_areas', 1),
                            'q_faqs' => request('q_faqs'),
                        ])->links() !!}
                    </div>
                </div>

                {{-- Aba Startups --}}
                <div class="tab-pane fade {{ $activeTab === 'startups' ? 'show active' : '' }}" id="startups-pane" role="tabpanel" aria-labelledby="startups-tab">
                    <div class="d-flex flex-column flex-lg-row align-items-lg-center justify-content-lg-between mb-3 gap-2">
                        <form class="row g-2 flex-grow-1" method="get">
                            <input type="hidden" name="tab" value="startups">
                            <input type="hidden" name="page_startups" value="1">
                            <input type="hidden" name="q_editais" value="{{ request('q_editais') }}">
                            <input type="hidden" name="page_editais" value="{{ request('page_editais', 1) }}">
                            <input type="hidden" name="q_decretos" value="{{ request('q_decretos') }}">
                            <input type="hidden" name="page_decretos" value="{{ request('page_decretos', 1) }}">
                            <input type="hidden" name="q_areas" value="{{ request('q_areas') }}">
                            <input type="hidden" name="page_areas" value="{{ request('page_areas', 1) }}">
                            <input type="hidden" name="q_faqs" value="{{ request('q_faqs') }}">
                            <input type="hidden" name="page_faqs" value="{{ request('page_faqs', 1) }}">

                            <div class="col-md-6">
                                <input type="text" class="form-control" name="q_startups" placeholder="{{ __('Pesquisar por nome ou descrição...') }}" value="{{ request('q_startups') }}">
                            </div>
                            <div class="col-md-5">
                                <select name="segmento" class="form-select">
                                    <option value="">{{ __('Todos os segmentos') }}</option>
                                    <option value="tecnologia" {{ request('segmento') === 'tecnologia' ? 'selected' : '' }}>{{ __('tecnologia') }}</option>
                                    <option value="energia" {{ request('segmento') === 'energia' ? 'selected' : '' }}>{{ __('energia') }}</option>
                                    <option value="logistica" {{ request('segmento') === 'logistica' ? 'selected' : '' }}>{{ __('logística') }}</option>
                                    <option value="sustentabilidade" {{ request('segmento') === 'sustentabilidade' ? 'selected' : '' }}>{{ __('sustentabilidade') }}</option>
                                    <option value="nautica_naval" {{ request('segmento') === 'nautica_naval' ? 'selected' : '' }}>{{ __('náutica e naval') }}</option>
                                </select>
                            </div>
                            <div class="col-md-1 d-grid">
                                <button class="btn btn-outline-success" type="submit" title="{{ __('Pesquisar') }}">
                                    <i class="fa-solid fa-magnifying-glass"></i>
                                </button>
                            </div>
                        </form>

                        <div class="text-lg-end">
                            @if (auth()->user()->getPermissaoDetalhes('GERENCIADOR_DE_PARQUE_TECNOLOGICO')['adicionar'])
                                <a href="{{ route('admin.parqueTecnologico.startups.create') }}" class="btn btn-sm btn-success">
                                    <i class="fa-solid fa-plus me-1"></i> {{ __('Nova Startup') }}
                                </a>
                            @endif
                        </div>
                    </div>

                    <div class="table-responsive">
                        <table class="table table-bordered table-hover table-striped align-middle text-center mb-0">
                            @include('components.tables._thead', ['thead' => [__('Nome'), __('Segmento'), __('Status'), __('Ações')]])
                            <tbody>
                                @php $index = 0; @endphp
                                @forelse($startups as $startup)
                                    <tr>
                                        <td class="text-start">{{ \Illuminate\Support\Str::limit($startup->nome, 80) }}</td>
                                        <td>
                                            {{ __($startup->segmento === 'nautica_naval' ? 'náutica e naval' : $startup->segmento) }}
                                        </td>
                                        <td class="text-center align-middle">
                                            @include('components.buttons._status', [
                                                'index' => $index,
                                                'idPrefix' => 'startups',
                                                'route' => 'admin.parqueTecnologico.startups.status',
                                                'id' => $startup->id,
                                                'status' => $startup->status,
                                                'permission' => 'GERENCIADOR_DE_PARQUE_TECNOLOGICO',
                                                'queryParams' => [
                                                    'tab' => 'startups',
                                                    'page_startups' => request('page_startups', 1),
                                                    'q_startups' => request('q_startups'),
                                                    'segmento' => request('segmento'),
                                                ],
                                            ])
                                        </td>
                                        <td class="text-nowrap text-center align-middle">
                                            <div class="btn-group" role="group">
                                                <a href="{{ route('admin.parqueTecnologico.startups.edit', $startup->id) }}" class="btn btn-sm btn-warning" title="{{ __('Editar') }}">
                                                    <i class="fa-solid fa-pen-to-square"></i>
                                                </a>
                                                @if (auth()->user()->getPermissaoDetalhes('GERENCIADOR_DE_PARQUE_TECNOLOGICO')['excluir'])
                                                    <form class="d-inline" action="{{ route('admin.parqueTecnologico.startups.destroy', $startup->id) }}" method="post" onsubmit="return confirmDelete(this)">
                                                        @csrf
                                                        @method('delete')
                                                        <input type="hidden" name="confirm" value="{{ __('Esta startup será excluída. Deseja continuar?') }}">
                                                        <button type="submit" class="btn btn-sm btn-danger" title="{{ __('Excluir') }}">
                                                            <i class="fa-solid fa-trash"></i>
                                                        </button>
                                                    </form>
                                                @endif
                                            </div>
                                        </td>
                                    </tr>
                                    @php $index++; @endphp
                                @empty
                                    <tr>
                                        <td colspan="4" class="text-muted fst-italic">{{ __('Nenhuma startup cadastrada.') }}</td>
                                    </tr>
                                @endforelse
                            </tbody>
                        </table>
                    </div>
                    <div class="d-flex justify-content-center mt-3">
                        {!! $startups->appends([
                            'tab' => 'startups',
                            'q_startups' => request('q_startups'),
                            'segmento' => request('segmento'),
                        ])->links() !!}
                    </div>
                </div>
            </div>
        </div>
    </div>
@endsection
