mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-09-12 12:37:14 +00:00
refactor: upgrade gpt-vis (#1883)
This commit is contained in:
@@ -1,14 +1,18 @@
|
||||
import markdownComponents from '@/components/chat/chat-content/config';
|
||||
import React from 'react';
|
||||
import ReactMarkdown from 'react-markdown';
|
||||
import { GPTVis } from '@antv/gpt-vis';
|
||||
import rehypeRaw from 'rehype-raw';
|
||||
import remarkGfm from 'remark-gfm';
|
||||
|
||||
const MarkDownContext: React.FC<{ children: string }> = ({ children }) => {
|
||||
return (
|
||||
<ReactMarkdown components={{ ...markdownComponents }} rehypePlugins={[rehypeRaw]} remarkPlugins={[remarkGfm]}>
|
||||
<GPTVis
|
||||
components={{ ...markdownComponents }}
|
||||
rehypePlugins={[rehypeRaw]}
|
||||
remarkPlugins={[remarkGfm]}
|
||||
>
|
||||
{children}
|
||||
</ReactMarkdown>
|
||||
</GPTVis>
|
||||
);
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user