feat(pages): add reusable page block editor and renderer baseline

This commit is contained in:
2026-02-12 22:38:00 +01:00
parent d016650463
commit 6e9c0ad4e5
8 changed files with 576 additions and 44 deletions

View File

@@ -10,6 +10,7 @@ import Link from "next/link"
import { redirect } from "next/navigation"
import { AdminShell } from "@/components/admin-shell"
import { PageBlockEditor } from "@/components/pages/page-block-editor"
import { requirePermissionForRoute } from "@/lib/route-guards"
export const dynamic = "force-dynamic"
@@ -242,16 +243,7 @@ export default async function PageEditorPage({ params, searchParams }: PageProps
/>
</label>
<label className="space-y-1">
<span className="text-xs text-neutral-600">Content</span>
<textarea
name="content"
rows={10}
defaultValue={page.content}
required
className="w-full rounded border border-neutral-300 px-3 py-2 text-sm"
/>
</label>
<PageBlockEditor name="content" initialContent={page.content} />
<div className="grid gap-3 md:grid-cols-2">
<label className="space-y-1">
@@ -368,16 +360,11 @@ export default async function PageEditorPage({ params, searchParams }: PageProps
/>
</label>
<label className="space-y-1">
<span className="text-xs text-neutral-600">Content</span>
<textarea
name="content"
rows={8}
defaultValue={selectedTranslation?.content ?? page.content}
required
className="w-full rounded border border-neutral-300 px-3 py-2 text-sm"
/>
</label>
<PageBlockEditor
name="content"
initialContent={selectedTranslation?.content ?? page.content}
label="Translation Blocks"
/>
<div className="grid gap-3 md:grid-cols-2">
<label className="space-y-1">