Merge pull request #7 from heimoshuiyu/react-18
Some checks failed
Build static content / build (push) Failing after 19s

downgrade react 18, fix markdown, fix #6
This commit is contained in:
2024-12-31 18:09:43 +08:00
committed by GitHub
5 changed files with 168 additions and 5592 deletions

View File

@@ -155,9 +155,7 @@ export default function Message(props: { messageIndex: number }) {
) : chat.role === "tool" ? (
<MessageToolResp chat={chat} copyToClipboard={copyToClipboard} />
) : renderMarkdown ? (
// [TODO] It is happening https://github.com/remarkjs/react-markdown/pull/879
// <Markdown>{getMessageText(chat)}</Markdown>
<></>
<Markdown>{getMessageText(chat)}</Markdown>
) : (
<div className="message-content">
{chat.content &&

View File

@@ -1,4 +1,5 @@
import { ChatStoreMessage } from "@/types/chatstore";
import Markdown from "react-markdown";
interface Props {
chat: ChatStoreMessage;
@@ -15,8 +16,7 @@ export function MessageDetail({ chat, renderMarkdown }: Props) {
chat.hide ? (
mdt.text?.split("\n")[0].slice(0, 16) + " ..."
) : renderMarkdown ? (
// @ts-ignore
<Markdown markdown={mdt.text} />
<Markdown>{mdt.text}</Markdown>
) : (
mdt.text
)