Files
mai-bot/dashboard/src/components/ui/markdown.tsx
2026-01-13 06:24:35 +08:00

29 lines
609 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { MarkdownRenderer } from '@/components/markdown-renderer'
interface MarkdownProps {
children: string
className?: string
}
/**
* Markdown 组件 - 用于渲染 Markdown 内容(支持 GFM 和 LaTeX
*
* @example
* ```tsx
* <Markdown>
* # 标题
* 这是一段 **加粗** 的文字
*
* 数学公式:$E = mc^2$
*
* 块级公式:
* $$
* \int_{-\infty}^{\infty} e^{-x^2} dx = \sqrt{\pi}
* $$
* </Markdown>
* ```
*/
export function Markdown({ children, className }: MarkdownProps) {
return <MarkdownRenderer content={children} className={className} />
}