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

@@ -1,5 +1,8 @@
import { serializePageBlocks } from "@cms/content"
import { Button } from "@cms/ui/button"
import { PageBlockEditor } from "./page-block-editor"
type CreatePageFormProps = {
action: (formData: FormData) => void | Promise<void>
}
@@ -46,15 +49,16 @@ export function CreatePageForm({ action }: CreatePageFormProps) {
/>
</label>
<label className="space-y-1">
<span className="text-xs text-neutral-600">Content</span>
<textarea
name="content"
rows={6}
required
className="w-full rounded border border-neutral-300 px-3 py-2 text-sm"
/>
</label>
<PageBlockEditor
name="content"
initialContent={serializePageBlocks([
{
id: "initial-rich-text",
type: "rich_text",
body: "",
},
])}
/>
<div className="grid gap-3 md:grid-cols-2">
<label className="space-y-1">