import { notFound } from 'next/navigation'; import Link from 'next/link'; import { AdminShell } from '@/components/admin/AdminShell'; import { PostEditor } from '@/components/admin/PostEditor'; import type { JsonValue } from '@/components/admin/JsonForm'; import { loadContent } from '@/lib/content/load'; import { loadPost, loadPostOverrides, isKnownSlug } from '@/lib/content/posts-store'; // Always render on demand so the editor mirrors current DB state. export const dynamic = 'force-dynamic'; export default function AdminPostEditorPage({ params }: { params: { slug: string } }) { const { slug } = params; if (!isKnownSlug(slug)) notFound(); const post = loadPost(slug); if (!post) notFound(); const overridden = slug in loadPostOverrides(); const { en } = loadContent(); const title = en.blog.items.find((p) => p.slug === slug)?.title ?? slug; return (
← Journal articles

{title}

Edit the lead and body blocks for both languages, then save. Changes go live immediately.

); }