import Link from 'next/link'; import { AdminShell } from '@/components/admin/AdminShell'; import { loadContent } from '@/lib/content/load'; import { loadAllPosts, loadPostOverrides } from '@/lib/content/posts-store'; // Always reflect live DB state in the editor list. export const dynamic = 'force-dynamic'; export default function AdminPostsPage() { const posts = loadAllPosts(); const overrides = loadPostOverrides(); const { en } = loadContent(); const cardBySlug = new Map( en.blog.items.map((p) => [p.slug, p]), ); const slugs = Object.keys(posts); const editedCount = Object.keys(overrides).length; return (

Journal articles

Edit the full bilingual body of each post.{' '} {editedCount > 0 ? `${editedCount} article${editedCount > 1 ? 's' : ''} customized.` : 'All articles are at their defaults.'}{' '} Titles, excerpts and read time live under the{' '} Journal {' '} section.

{slugs.map((slug) => { const card = cardBySlug.get(slug); const post = posts[slug]; const edited = slug in overrides; return (

{card?.title ?? slug}

{edited ? ( edited ) : ( default )}
{card?.category ?? '—'} · {post.date}
); })}
); }