{% extends "base.html" %}
{% block content %}
<div class="header">
  <div>
    <div class="kicker">Editing surface</div>
    <h2 style="margin:8px 0 0">Edit Memory</h2>
    <div class="small">Active scope: <strong>{{ active_scope.label }}</strong></div>
  </div>
  <span class="badge green">You control what AI remembers</span>
</div>

<div class="grid cols-2">
  <div class="card">
    <h3>Memory files</h3>
    <div class="list">
      {% for file in files %}
      <div class="item">
        <a class="{% if file.active %}active-link{% endif %}" href="/files/{{ file.name }}{{ active_scope.query_suffix }}">{{ file.name }}</a>
      </div>
      {% endfor %}
    </div>
  </div>

  <div class="card">
    <h3>{{ name }}</h3>
    <form method="post" action="/files/{{ name }}{{ active_scope.query_suffix }}">
      <textarea name="content" rows="28">{{ content }}</textarea>
      <div class="actions">
        <a class="btn" href="/files{{ active_scope.query_suffix }}">Back to files</a>
        <button class="btn primary" type="submit">Save changes</button>
      </div>
    </form>
  </div>
</div>
{% endblock %}
