import { notFound } from 'next/navigation'; import Link from 'next/link'; import { AdminShell } from '@/components/admin/AdminShell'; import { SectionEditor } from '@/components/admin/SectionEditor'; import type { JsonValue } from '@/components/admin/JsonForm'; import { isEditableKey, sectionLabel } from '@/lib/content/sections'; import { loadSection } from '@/lib/content/load'; import { getSection } from '@/lib/db/store'; // Always render on demand: the editor must reflect the current DB state, and // generateStaticParams would otherwise bake build-time defaults into the page. export const dynamic = 'force-dynamic'; export default function SectionEditorPage({ params }: { params: { key: string } }) { const { key } = params; if (!isEditableKey(key)) notFound(); const data = loadSection(key); const label = sectionLabel(key); const isOverridden = getSection(key) !== null; return (
← Dashboard

{label.en} {label.fa}

Edit both languages with the FA / EN tabs, then save. Changes go live immediately.

); }