quartz-research-note/quartz/components/pages/Content.tsx

12 lines
507 B
TypeScript
Raw Normal View History

2023-07-01 07:03:01 +00:00
import { QuartzComponentConstructor, QuartzComponentProps } from "../types"
2023-07-23 00:27:41 +00:00
import { Fragment, jsx, jsxs } from "preact/jsx-runtime"
2023-07-01 07:03:01 +00:00
import { toJsxRuntime } from "hast-util-to-jsx-runtime"
function Content({ tree }: QuartzComponentProps) {
// @ts-ignore (preact makes it angry)
2023-07-23 00:27:41 +00:00
const content = toJsxRuntime(tree, { Fragment, jsx, jsxs, elementAttributeNameCase: "html" })
2023-07-02 20:08:29 +00:00
return <article class="popover-hint">{content}</article>
2023-07-01 07:03:01 +00:00
}
2023-07-02 20:08:29 +00:00
export default (() => Content) satisfies QuartzComponentConstructor