Skip to content
File

Blob: src/sites/static-renderer/index.ts

typescript19 lines
1import type { JSONContent } from "@tiptap/core";
2import type { Node as ProseMirrorNode } from "@tiptap/pm/model";
3import { renderToReactElement } from "@tiptap/static-renderer/pm/react";
4import type { ReactNode } from "react";
5import { createHeadlessEditorExtensions } from "@/shared/editor/schema";
6import { createBlandSitesStaticNodeMappings } from "./node-mappings";
7 
8export function renderBlandSitesDocumentToReactElement(content: ProseMirrorNode | JSONContent): ReactNode {
9 return renderToReactElement({
10 content,
11 extensions: createHeadlessEditorExtensions(),
12 options: {
13 nodeMapping: createBlandSitesStaticNodeMappings(),
14 },
15 });
16}
17 
18export type { SitesPageMentionRenderInfo } from "@/sites/types";