downgrade react 18, fix markdown

This commit is contained in:
2024-12-31 12:00:18 +08:00
parent a56aa0205d
commit 2b19648ffb
5 changed files with 168 additions and 5592 deletions

2364
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -38,8 +38,8 @@
"@radix-ui/react-toggle": "^1.1.1", "@radix-ui/react-toggle": "^1.1.1",
"@radix-ui/react-toggle-group": "^1.1.1", "@radix-ui/react-toggle-group": "^1.1.1",
"@radix-ui/react-tooltip": "^1.1.6", "@radix-ui/react-tooltip": "^1.1.6",
"@types/react": "^19.0.2", "@types/react": "^18.0.0",
"@types/react-dom": "^19.0.2", "@types/react-dom": "^18.0.0",
"@types/ungap__structured-clone": "^1.2.0", "@types/ungap__structured-clone": "^1.2.0",
"@ungap/structured-clone": "^1.2.1", "@ungap/structured-clone": "^1.2.1",
"class-variance-authority": "^0.7.1", "class-variance-authority": "^0.7.1",
@@ -51,9 +51,9 @@
"input-otp": "^1.4.1", "input-otp": "^1.4.1",
"lucide-react": "^0.469.0", "lucide-react": "^0.469.0",
"next-themes": "^0.4.4", "next-themes": "^0.4.4",
"react": "^19.0.0", "react": "^18.0.0",
"react-day-picker": "9.4.4", "react-day-picker": "9.4.4",
"react-dom": "^19.0.0", "react-dom": "^18.0.0",
"react-hook-form": "^7.54.2", "react-hook-form": "^7.54.2",
"react-markdown": "^9.0.1", "react-markdown": "^9.0.1",
"react-resizable-panels": "^2.1.7", "react-resizable-panels": "^2.1.7",

View File

@@ -155,9 +155,7 @@ export default function Message(props: { messageIndex: number }) {
) : chat.role === "tool" ? ( ) : chat.role === "tool" ? (
<MessageToolResp chat={chat} copyToClipboard={copyToClipboard} /> <MessageToolResp chat={chat} copyToClipboard={copyToClipboard} />
) : renderMarkdown ? ( ) : 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"> <div className="message-content">
{chat.content && {chat.content &&

View File

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

3380
yarn.lock

File diff suppressed because it is too large Load Diff