<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <meta name="csrf-token" content="{{ csrf_token() }}">
        <title>{{ config('app.name', 'Laravel') }}</title>
        @vite(['resources/css/app.css', 'resources/js/app.js'])
    </head>
    <body id="app">

        <!-- app navigation -->
        @include('layouts.navigation')

        <!-- content -->
        <main>

            @isset($aside)
            <aside>
                {{ $aside }}
            </aside>
            @endisset

            <article {{ $attributes }}>

                @isset($header)
                <header>
                    {{ $header }}
                </header>
                @endisset

                {{ $article ?? $slot }}

            </article>

        </main>

        <!-- toasts -->
        <dl class="toasts" role="status" aria-live="polite" aria-atomic="true">
        @if (session()->has('toast'))
            @php
                $toast = session('toast');
                $message = is_array($toast) ? ($toast['message'] ?? '') : $toast;
                $type = is_array($toast) ? ($toast['type'] ?? 'success') : 'success';
            @endphp
            <dt class="{{ $type }}">{{ $type }}</dt>
            <dd class="message">{{ $message }}</dd>
        @endif
        </dl>

        <!-- modal -->
        <x-modal />

    </body>
</html>
