perf: init chat content.use mongo aggregate

This commit is contained in:
archer
2023-04-24 17:49:39 +08:00
parent 1f112f7715
commit e60c36b423
6 changed files with 49 additions and 57 deletions

View File

@@ -1,4 +1,4 @@
import React, { memo, useMemo } from 'react';
import React, { memo } from 'react';
import ReactMarkdown from 'react-markdown';
import { Prism as SyntaxHighlighter } from 'react-syntax-highlighter';
import { Box, Flex, useColorModeValue } from '@chakra-ui/react';
@@ -14,7 +14,6 @@ import { codeLight } from './codeLight';
const Markdown = ({ source, isChatting = false }: { source: string; isChatting?: boolean }) => {
const { copyData } = useCopyData();
const formatSource = useMemo(() => source, [source]);
return (
<ReactMarkdown
@@ -63,7 +62,7 @@ const Markdown = ({ source, isChatting = false }: { source: string; isChatting?:
}}
linkTarget="_blank"
>
{formatSource}
{source}
</ReactMarkdown>
);
};