20 lines
467 B
TypeScript
20 lines
467 B
TypeScript
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
|
|
}
|
|
console.log({ nodes })
|
|
return (
|
|
<section style={{ display: "grid", gap: "var(--Spacing-x3" }}>
|
|
{nodesToHtml(nodes, embeds, renderOptions).filter(Boolean)}
|
|
</section>
|
|
)
|
|
}
|