{% import "partials/icons.html" as icons %}
{% macro nav(active, user, csrf_token, fika_installed) %}
<div class="links">
    <a href="/"{% if active == "dashboard" %} class="active"{% endif %}>{% call icons::home() %}{% endcall %} Dashboard</a>
    {% if user.role.can_manage_mods() %}
    <a href="/mods"{% if active == "mods" %} class="active"{% endif %}>{% call icons::package() %}{% endcall %} Mods</a>
    {% endif %}
    <a href="/queue"{% if active == "queue" %} class="active"{% endif %}>{% call icons::list() %}{% endcall %} Queue</a>
    <a href="/status"{% if active == "status" %} class="active"{% endif %}>{% call icons::activity() %}{% endcall %} Status</a>
    {% if fika_installed %}
    <a href="/clients"{% if active == "clients" %} class="active"{% endif %}>{% call icons::users() %}{% endcall %} Clients</a>
    {% endif %}
    <a href="/logs"{% if active == "logs" %} class="active"{% endif %}>{% call icons::terminal() %}{% endcall %} Logs</a>
    {% if user.role.can_manage_users() %}
    <a href="/admin"{% if active == "admin" %} class="active"{% endif %}>{% call icons::shield() %}{% endcall %} Admin</a>
    {% endif %}
</div>
<div class="user-info">
    {{ user.username }} ({{ user.role }})
    <form method="post" action="/logout" style="display:inline">
        <input type="hidden" name="csrf_token" value="{{ csrf_token }}">
        <button type="submit" class="btn btn-sm btn-outline" style="margin-left:0.5rem">{% call icons::log_out() %}{% endcall %} Logout</button>
    </form>
</div>
{% endmacro %}
