@extends('web.layouts.layout')

@section('container_content')
    @if(\Illuminate\Support\Facades\Route::currentRouteName() == 'home')
        @include('web.layouts.home_nav')
    @else
        @include('web.layouts.nav')
    @endif
    <main>
        @yield('content')
        @include('web.layouts.contact_partners_newsletter')
    </main>
    @include('web.layouts.footer')

    <div class="modal confirmConsult fade alert_pop_up" id="confirmConsult" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
        <div class="modal-dialog modal-dialog-centered modal-lg">
            <div class="modal-content">
                <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
                <div class="modal-body">
                    <img src="{{asset('assets/web/images/icons/confirm.png')}}" alt="" class="icon"/>
                    <div class="content text-center mt-4">
                        <h3 class="title text-dark mb-2"><b>{{session('alert_title')}}</b></h3>
                        <p class="text">
                            {{session('alert_title') . ', ' . session('alert_message')}}
                        </p>
                    </div>
                </div>
            </div>
        </div>
    </div>

@endsection

@section('container_js')
    <script>
        axios.defaults.headers.common = {
            'X-Requested-With': 'XMLHttpRequest',
            'X-CSRF-TOKEN' : document.querySelector('meta[name="csrf-token"]').getAttribute('content')
        };
    </script>

    <script>
        if("{{session('alert_title')}}" && "{{session('alert_message')}}"){
            let myModal = new bootstrap.Modal(document.querySelector('.alert_pop_up'));
            myModal.show();
        }
    </script>

    <script src="{{ asset('assets/web/js/actions.js') }}"></script>
    @yield('inner_js')
@endsection
