<?php

use Lab\Helpers;

$here = Helpers::requestPath();
?>
<header class="studio-top">
    <a class="brand" href="<?= Helpers::url('/studio') ?>">
        <img src="<?= Helpers::url('/logo.png') ?>" alt="" width="48" height="48">
        <span>
            <strong>Panorama Lab</strong>
            <em>Studio · <?= Helpers::e($userName ?? '') ?><?php if (! empty($config['version'])): ?> · <?= Helpers::e((string) $config['version']) ?><?php endif; ?></em>
        </span>
    </a>
    <nav class="studio-nav">
        <a class="<?= $here === '/studio' || str_starts_with($here, '/studio/orders') ? 'on' : '' ?>" href="<?= Helpers::url('/studio') ?>">Παραγγελίες</a>
        <a class="<?= $here === '/studio/report' ? 'on' : '' ?>" href="<?= Helpers::url('/studio/report') ?>">Αναφορά</a>
        <a class="<?= $here === '/studio/products' ? 'on' : '' ?>" href="<?= Helpers::url('/studio/products') ?>">Τιμές</a>
        <a class="<?= $here === '/studio/settings' ? 'on' : '' ?>" href="<?= Helpers::url('/studio/settings') ?>">Εκτυπωτές</a>
        <?php if (! \Lab\License::isKiosk()): ?>
            <a class="<?= $here === '/studio/licenses' ? 'on' : '' ?>" href="<?= Helpers::url('/studio/licenses') ?>">Άδειες</a>
        <?php endif; ?>
        <a href="<?= Helpers::url('/kiosk') ?>">Κιόσκ</a>
        <a href="<?= Helpers::url('/web') ?>">Web</a>
        <form method="POST" action="<?= Helpers::url('/studio/logout') ?>">
            <input type="hidden" name="csrf_token" value="<?= Helpers::csrfToken() ?>">
            <button class="btn btn-ghost" type="submit">Έξοδος</button>
        </form>
    </nav>
</header>
