{% extends "base.html" %}
{% from "_macros.html" import icon %}
{#
  The library shell.

  Keeps the chat sidebar rather than having its own like the admin area does:
  administration is a different place, but a library is part of using the thing
  — you go there mid-conversation to add a document and come straight back.
#}

{% block head %}
<link rel="stylesheet" href="{{ url_for('static', path='css/chat.css') }}">
<link rel="stylesheet" href="{{ url_for('static', path='css/admin.css') }}">
{% endblock %}

{% block body_attrs %} data-authenticated="true"{% endblock %}

{% block body %}
<div class="shell">
  {% include "partials/sidebar.html" %}

  <main class="main">
    <header class="topbar">
      <h1 class="topbar__title">{% block heading %}Library{% endblock %}</h1>
      <div class="topbar__actions">{% block actions %}{% endblock %}</div>
    </header>

    <nav class="tabs__bar" aria-label="Library">
      <a class="tabs__tab {{ 'is-active' if section == 'knowledge' }}"
         href="/library/knowledge">{{ icon("archive", "icon--sm") }} Knowledge</a>
      <a class="tabs__tab {{ 'is-active' if section == 'notes' }}"
         href="/library/notes">{{ icon("pencil", "icon--sm") }} Notes</a>
      <a class="tabs__tab {{ 'is-active' if section == 'skills' }}"
         href="/library/skills">{{ icon("sparkle", "icon--sm") }} Skills</a>
      <span class="spacer"></span>
      <a class="tabs__tab" href="/settings">{{ icon("user", "icon--sm") }} Memory</a>
    </nav>

    <div class="admin-scroll">
      <div class="admin-page">
        {% block library_content %}{% endblock %}
      </div>
    </div>
  </main>
</div>
{% endblock %}
