fix: render del bug

This commit is contained in:
2023-11-10 17:26:27 +08:00
parent 33f4ab7b42
commit ebf00353f6

View File

@@ -315,31 +315,16 @@ export default function Message(props: Props) {
/> />
) )
) )
) : renderMarkdown ? ( ) : chat.tool_calls ? (
// @ts-ignore
<Markdown markdown={getMessageText(chat)} />
) : (
<div className="message-content">
{
// only show when content is string or list of message
chat.content && getMessageText(chat)
}
</div>
)}
{chat.tool_calls && (
<div className="message-content"> <div className="message-content">
<div> <div>
{chat.tool_calls?.map((tool_call) => ( {chat.tool_calls?.map((tool_call) => (
<> <div className="bg-blue-300 dark:bg-blue-800 p-1 rounded my-1">
<hr className="my-1" />
<div className="bg-blue-300 dark:bg-blue-800 p-1 rounded">
<strong> <strong>
Tool Call ID:{" "} Tool Call ID:{" "}
<span <span
className="p-1 m-1 rounded cursor-pointer hover:opacity-50 hover:underline" className="p-1 m-1 rounded cursor-pointer hover:opacity-50 hover:underline"
onClick={() => onClick={() => copyToClipboard(String(tool_call.id))}
copyToClipboard(String(tool_call.id))
}
> >
{tool_call?.id} {tool_call?.id}
</span> </span>
@@ -368,10 +353,19 @@ export default function Message(props: Props) {
</span> </span>
</p> </p>
</div> </div>
</>
))} ))}
</div> </div>
</div> </div>
) : renderMarkdown ? (
// @ts-ignore
<Markdown markdown={getMessageText(chat)} />
) : (
<div className="message-content">
{
// only show when content is string or list of message
chat.content && getMessageText(chat)
}
</div>
)} )}
<hr className="mt-2" /> <hr className="mt-2" />
<div className="w-full flex justify-between"> <div className="w-full flex justify-between">