{% extends "admin/base.html" %}

{% block title %}{{ t(key="edit-about", lang=lang | default(value='sk')) }}{% endblock title %}

{% block content %}
<div class="space-y-2">
  <div class="flex flex-wrap items-center justify-between gap-3">
    <div>
      <h1 class="text-2xl font-bold">{{ t(key="edit-about", lang=lang | default(value='sk')) }}</h1>
      <p class="text-sm opacity-70">{{ t(key="update-about-page", lang=lang | default(value='sk')) }}</p>
    </div>
    <a href="/about" class="btn btn-ghost btn-sm">{{ t(key="view-page", lang=lang | default(value='sk')) }}</a>
  </div>

  <div class="card border border-base-300 bg-base-100 shadow-sm">
    <div class="card-body">
      <form method="post" action="/admin/about" class="space-y-2">
        <div class="form-control">
          <label class="label"><span class="label-text">{{ t(key="title", lang=lang | default(value='sk')) }}</span></label>
          <input type="text" name="title" value="{{ page.title }}" required class="input input-bordered w-full">
        </div>

        <div class="form-control">
          <label class="label"><span class="label-text">{{ t(key="content", lang=lang | default(value='sk')) }}</span></label>
          <textarea name="content" rows="16" required class="textarea textarea-bordered w-full">{{ page.content }}</textarea>
        </div>

        <div class="flex flex-wrap gap-2 pt-2">
          <button type="submit" class="btn btn-neutral btn-sm">{{ t(key="save", lang=lang | default(value='sk')) }}</button>
          <a href="/admin/dashboard" class="btn btn-ghost btn-sm">{{ t(key="cancel", lang=lang | default(value='sk')) }}</a>
        </div>
      </form>
    </div>
  </div>
</div>
{% endblock content %}
