@extends('layouts.admin.theme')
@section('title', env('APP_NAME') . ' :: ' . __('Nova Empresa de Turísmo'))
@section('content')

    <form
        action="{{ route('admin.empresasDeTurismo.store') }}"
        method="post"
        enctype="multipart/form-data"
        data-empresa-turismo-form
        data-invalid-field-message="{{ __('Corrija o campo ":field" antes de salvar.') }}"
    >
        <div class="container mt-5">
            <div class="row">
                <div class="col-12">
                    <div class="card shadow">
                        @php $headLine = "<i class='fa-solid fa-water'></i> " . __('Nova Empresa de Turísmo'); @endphp

                        @include('components.buttons._headLineButtonsBackAdd', [
                            'headLine' => __($headLine),
                            'routeBack' => 'admin.empresasDeTurismo.index',
                            'routeBackParams' => [],
                            'nameBack' => __('Voltar'),
                            'permission' => 'GERENCIADOR_DE_EMPRESAS_DE_TURISMO',
                        ])

                        <div class="card-body">
                            @csrf
                            @include('errors.messageFlash')

                            <div id="prepostoCpfAlert" class="alert alert-danger d-none" role="alert">
                                {{ __('O CPF do preposto deve ser diferente do CPF do responsável.') }}
                            </div>

                            <div id="empresaTurismoFormAlert" class="alert alert-danger d-none" role="alert" aria-live="polite"></div>

                            @if($errors->any())
                                <div class="alert alert-danger" role="alert">
                                    <ul class="mb-0 ps-3">
                                        @foreach($errors->all() as $error)
                                            <li>{{ $error }}</li>
                                        @endforeach
                                    </ul>
                                </div>
                            @endif

                            <ul class="nav nav-pills mb-3 justify-content-center bg-light p-2 rounded shadow-sm" role="tablist">
                                @include('components.lists._liLinkBtnNavInterna', [
                                    'items' => [
                                        ['class' => 'active', 'hash' => 'primeiraSection', 'label' => __('Empresa')],
                                        ['class' => '', 'hash' => 'segundaSection', 'label' => __('Contato')],
                                        ['class' => '', 'hash' => 'terceiraSection', 'label' => __('Endereço')],
                                        ['class' => '', 'hash' => 'quartaSection', 'label' => __('Responsável Legal')],
                                        ['class' => '', 'hash' => 'quintaSection', 'label' => __('Preposto')],
                                        ['class' => '', 'hash' => 'sextaSection', 'label' => __('Documentos')],
                                    ],
                                ])
                            </ul>

                            <div class="tab-content">
                                <div class="tab-pane fade show active py-3" id="primeiraSection">
                                    @include('admin.turisAngra.empresasDeTurismo.sections.dadosEmpresa')
                                    @include('components.buttons._empresaTurismoTabNav', [
                                        'prevDisabled' => true,
                                        'next' => 'segundaSection',
                                    ])
                                </div>

                                <div class="tab-pane fade py-3" id="segundaSection">
                                    @include('admin.turisAngra.empresasDeTurismo.sections.contatoEmpresa')
                                    @include('components.buttons._empresaTurismoTabNav', [
                                        'prev' => 'primeiraSection',
                                        'next' => 'terceiraSection',
                                    ])
                                </div>

                                <div class="tab-pane fade py-3" id="terceiraSection">
                                    @include('admin.turisAngra.empresasDeTurismo.sections.enderecoEmpresa')
                                    @include('components.buttons._empresaTurismoTabNav', [
                                        'prev' => 'segundaSection',
                                        'next' => 'quartaSection',
                                    ])
                                </div>

                                <div class="tab-pane fade py-3" id="quartaSection">
                                    @include('admin.turisAngra.empresasDeTurismo.sections.responsavelEmpresa')
                                    @include('components.buttons._empresaTurismoTabNav', [
                                        'prev' => 'terceiraSection',
                                        'next' => 'quintaSection',
                                    ])
                                </div>

                                <div class="tab-pane fade py-3" id="quintaSection">
                                    @include('admin.turisAngra.empresasDeTurismo.sections.prepostoEmpresa')
                                    @include('components.buttons._empresaTurismoTabNav', [
                                        'prev' => 'quartaSection',
                                        'next' => 'sextaSection',
                                    ])
                                </div>

                                <div class="tab-pane fade py-3" id="sextaSection">
                                    @include('admin.turisAngra.empresasDeTurismo.sections.documentosEmpresa')
                                    @include('components.buttons._empresaTurismoTabNav', [
                                        'prev' => 'quintaSection',
                                        'submit' => true,
                                    ])
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </form>

@endsection

@push('scripts')
    <script src="{{ asset('turismo-nautico/js/empresas-de-turismo.js') }}"></script>
@endpush
