Fix types, replace preact with react

This commit is contained in:
2024-12-22 23:04:36 +08:00
parent c6fbe5c031
commit 926f3bea5c
11 changed files with 684 additions and 58 deletions

View File

@@ -1,5 +1,5 @@
import { XMarkIcon } from "@heroicons/react/24/outline";
import Markdown from "preact-markdown";
import Markdown from "react-markdown";
import { useState, useEffect, StateUpdater } from "preact/hooks";
import { Tr, langCodeContext, LANG_OPTIONS } from "@/translate";
@@ -156,7 +156,7 @@ export default function Message(props: Props) {
) : chat.role === "tool" ? (
<MessageToolResp chat={chat} copyToClipboard={copyToClipboard} />
) : renderMarkdown ? (
<Markdown markdown={getMessageText(chat)} />
<Markdown>{getMessageText(chat)}</Markdown>
) : (
<div className="message-content">
{chat.content &&