Skip to content
Source
Sign inSign up
TanStack/ai
Open History to see the last commit

Markdown.tsx

19 lines560 Bytes

1import ReactMarkdown from 'react-markdown'
2import remarkGfm from 'remark-gfm'
3import rehypeRaw from 'rehype-raw'
4import rehypeSanitize from 'rehype-sanitize'
5import rehypeHighlight from 'rehype-highlight'
6import type { MarkdownProps } from '@/lib/reports/types'
7​
8export function Markdown({ content }: MarkdownProps) {
9 return (
10 <div className="markdown-content">
11 <ReactMarkdown
12 remarkPlugins={[remarkGfm]}
13 rehypePlugins={[rehypeRaw, rehypeSanitize, rehypeHighlight]}
14 >
15 {content}
16 </ReactMarkdown>
17 </div>
18 )