feat: json rich text editor, blocks, asides, general structure
This commit is contained in:
10
components/JsonToHtml/index.tsx
Normal file
10
components/JsonToHtml/index.tsx
Normal file
@@ -0,0 +1,10 @@
|
||||
import { nodesToHtml } from "./utils"
|
||||
|
||||
import type { JsonToHtmlProps } from "@/types/components/jsontohtml"
|
||||
|
||||
export default function JsonToHtml({ embeds, nodes, renderOptions = {} }: JsonToHtmlProps) {
|
||||
if (!Array.isArray(nodes) || !nodes.length) {
|
||||
return null
|
||||
}
|
||||
return <>{nodesToHtml(nodes, embeds, renderOptions).filter(Boolean)}</>
|
||||
}
|
||||
Reference in New Issue
Block a user