import ReactMarkdown from "react-markdown" import remarkGfm from "remark-gfm" import SyntaxHighlighter from 'react-syntax-highlighter/dist/cjs/prism-async-light'; import rehypeSlug from 'rehype-slug' import rehypeAutolinkHeadings from 'rehype-autolink-headings' // @ts-ignore because of no types in remark-a11y-emoji // import a11yEmoji from '@fec/remark-a11y-emoji'; import styles from './preview.module.css' import dark from 'react-syntax-highlighter/dist/cjs/styles/prism/vsc-dark-plus' import light from 'react-syntax-highlighter/dist/cjs/styles/prism/vs' import useSharedState from "@lib/hooks/use-shared-state"; type Props = { content: string | undefined height: number | string } const ReactMarkdownPreview = ({ content, height }: Props) => { const [themeType] = useSharedState('theme') return (
{String(children).replace(/\n$/, '')} ) : ( {children} ) } }}> {content || ""}
) } export default ReactMarkdownPreview