<?php

declare(strict_types=1);

$adminUser = HyroAdminAuth::user();

?>
<header class="hyro-admin-topbar">

    <div class="hyro-admin-topbar-left">

        <button
            type="button"
            class="hyro-admin-menu-toggle"
            id="hyroAdminMenuToggle"
            aria-label="Open admin navigation"
        >
            ☰
        </button>

        <div>

            <strong>HYRO ONE</strong>

            <span>ADMIN PORTAL</span>

        </div>

    </div>

    <div class="hyro-admin-user">

        <div class="hyro-admin-user-avatar">
            <?= hyro_escape(
                strtoupper(
                    substr(
                        (string) (
                            $adminUser['full_name'] ?? 'A'
                        ),
                        0,
                        1
                    )
                )
            ) ?>
        </div>

        <div>

            <strong>
                <?= hyro_escape(
                    $adminUser['full_name'] ?? 'Administrator'
                ) ?>
            </strong>

            <span>
                <?= hyro_escape(
                    $adminUser['role_code'] ?? 'ADMIN'
                ) ?>
            </span>

        </div>

        <a
            href="/experience/admin/logout.php"
            class="hyro-admin-signout"
        >
            Sign Out
        </a>

    </div>

</header>
