Files
web/components/DeprecatedJsonToHtml/index.tsx
2024-09-24 09:47:31 +02:00

21 lines
504 B
TypeScript

import { nodesToHtml } from "./utils"
import styles from "./jsontohtml.module.css"
import type { DeprecatedJsonToHtmlProps } from "@/types/components/deprecatedjsontohtml"
export default function DeprecatedJsonToHtml({
embeds,
nodes,
renderOptions = {},
}: DeprecatedJsonToHtmlProps) {
if (!Array.isArray(nodes) || !nodes.length) {
return null
}
return (
<section className={styles.container}>
{nodesToHtml(nodes, embeds, renderOptions).filter(Boolean)}
</section>
)
}