import { useMemo } from 'react'; import type { Components } from 'react-markdown'; import ReactMarkdown from 'react-markdown'; import rehypeKatex from 'rehype-katex'; import remarkGfm from 'remark-gfm'; import remarkMath from 'remark-math'; import MarkdownCodeBlock from './MarkdownCodeBlock'; type MarkdownPreviewProps = { content: string; }; const markdownPreviewComponents: Components = { code: MarkdownCodeBlock, blockquote: ({ children }) => (
{children}), a: ({ href, children }) => ( {children} ), table: ({ children }) => (