---
import Layout from '@/layouts/AdminLayout.astro';
import PostEditor from '@/components/admin/posts/PostEditor';

const { id } = Astro.params;
---

<Layout title="Edit Post">
  <div class="p-6">
     <div class="mb-6">
        <a href="/admin/posts" class="text-slate-400 hover:text-white flex items-center gap-2 mb-2">
            <svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 19l-7-7m0 0l7-7m-7 7h18" /></svg>
            Back to Posts
        </a>
        <h1 class="text-3xl font-bold text-slate-100">Edit Post</h1>
    </div>

    <PostEditor id={id} client:only="react" />
  </div>
</Layout>
