<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>@yield('title', 'Admin') — Web3 Derp</title>
    <link rel="preconnect" href="https://fonts.googleapis.com">
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
    <link href="https://fonts.googleapis.com/css2?family=Source+Sans+3:ital,wght@0,300..900;1,300..900&display=swap" rel="stylesheet">
    @php
        $vAdmin = @filemtime(public_path('css/admin.css')) ?: '1';
        $vWidth = @filemtime(public_path('css/content-width.css')) ?: '1';
    @endphp
    <link rel="stylesheet" href="{{ asset('css/content-width.css') }}?v={{ $vWidth }}">
    <link rel="stylesheet" href="{{ asset('css/admin.css') }}?v={{ $vAdmin }}">
    @stack('head')
</head>
<body class="admin-body {{ request()->routeIs('admin.settings.*') ? 'admin-body--settings' : '' }}">
    <div class="admin-shell">
        @include('admin.partials.sidebar')

        <div class="admin-main">
            <header class="admin-topbar">
                <div class="container admin-topbar-inner">
                    <span class="admin-role-badge">{{ auth()->user()->role->label() }}</span>
                    <div class="admin-avatar" title="{{ auth()->user()->name }}">
                        {{ strtoupper(substr(auth()->user()->name, 0, 1)) }}
                    </div>
                </div>
            </header>

            <main class="admin-content">
                <div class="container">
                    @unless(request()->routeIs('admin.settings.*'))
                        @include('admin.partials.alerts')
                    @endunless
                    @yield('content')
                    @if(request()->routeIs('admin.settings.*'))
                        @include('admin.partials.alerts', ['position' => 'bottom'])
                    @endif
                </div>
            </main>
        </div>
    </div>
    @stack('scripts')
</body>
</html>
