revite/src/components/markdown/Markdown.tsx

18 lines
359 B
TypeScript
Raw Normal View History

2021-06-19 13:46:05 -04:00
import { Suspense, lazy } from "preact/compat";
2021-07-05 06:23:23 -04:00
const Renderer = lazy(() => import("./Renderer"));
2021-06-19 13:46:05 -04:00
export interface MarkdownProps {
2021-07-05 06:23:23 -04:00
content?: string;
disallowBigEmoji?: boolean;
2021-06-19 13:46:05 -04:00
}
export default function Markdown(props: MarkdownProps) {
2021-07-05 06:23:23 -04:00
return (
// @ts-expect-error
<Suspense fallback={props.content}>
<Renderer {...props} />
</Suspense>
);
2021-06-19 13:46:05 -04:00
}