keroosha.cybergulag.today/quartz/components/Content.tsx

12 lines
485 B
TypeScript
Raw Normal View History

2023-06-12 09:46:38 +03:00
import { QuartzComponentConstructor, QuartzComponentProps } from "./types"
2023-06-10 09:06:02 +03:00
import { Fragment, jsx, jsxs } from 'preact/jsx-runtime'
import { toJsxRuntime } from "hast-util-to-jsx-runtime"
2023-06-12 09:46:38 +03:00
function Content({ tree }: QuartzComponentProps) {
2023-06-10 09:06:02 +03:00
// @ts-ignore (preact makes it angry)
const content = toJsxRuntime(tree, { Fragment, jsx, jsxs, elementAttributeNameCase: 'html' })
2023-06-17 22:07:40 +03:00
return <article>{content}</article>
2023-06-10 09:06:02 +03:00
}
2023-06-12 09:46:38 +03:00
export default (() => Content) satisfies QuartzComponentConstructor