feat(pages): add reusable page block editor and renderer baseline
This commit is contained in:
@@ -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">
|
||||
|
||||
Reference in New Issue
Block a user