<?php
// Sidebar del panel de usuario. Requiere $active (builds|reviews|license) y $u.
require_once __DIR__ . '/plugins.php';
$myLic = user_licenses((int)$u['id']);
?>
<aside class="pside">
  <div class="wcard">
    <div class="hi">👋 <span data-i18n="sideHi">Hola</span>, <?= e($u['username']) ?></div>
    <?php if ($myLic): ?>
      <div class="badges">
        <?php foreach ($myLic as $slug => $l): ?><?= plugin_badge($slug) ?><?php endforeach; ?>
      </div>
    <?php else: ?>
      <div class="none" data-i18n="sideNoPrem">Aún no tienes plugins Premium.</div>
    <?php endif; ?>
  </div>
  <nav class="pnav">
    <a href="<?= e(BASE) ?>/panel/" class="<?= $active==='builds'?'on':'' ?>"><span class="n">📥</span><span data-i18n="navMyPlugins">Mis plugins</span></a>
    <a href="<?= e(BASE) ?>/panel/license.php" class="<?= $active==='license'?'on':'' ?>"><span class="n">🔑</span><span data-i18n="navMyLicenses">Mis licencias</span></a>
    <a href="<?= e(BASE) ?>/" class="pnav-store"><span class="n">🛒</span><span data-i18n="navStore">Tienda</span></a>
  </nav>
</aside>
