refactor: upgrade gpt-vis (#1883)

This commit is contained in:
hustcc
2024-08-28 13:37:45 +08:00
committed by GitHub
parent 131bc7b89b
commit 1cb7e35295
12 changed files with 518 additions and 260 deletions

View File

@@ -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>
);
};