update no output message
This commit is contained in:
parent
d17f957411
commit
ab71831ca9
2 changed files with 37 additions and 40 deletions
|
|
@ -188,7 +188,7 @@ export default function ChatMessage({
|
|||
<Markdown
|
||||
remarkPlugins={[remarkGfm, remarkMath]}
|
||||
rehypePlugins={[rehypeMathjax]}
|
||||
className="markdown prose flex flex-col text-primary word-break-break-word dark:prose-invert"
|
||||
className={cn("markdown prose flex flex-col word-break-break-word dark:prose-invert",chatMessage === "" ? "text-chat-trigger-disabled" : "text-primary")}
|
||||
components={{
|
||||
pre({ node, ...props }) {
|
||||
return <>{props.children}</>;
|
||||
|
|
@ -235,7 +235,7 @@ export default function ChatMessage({
|
|||
},
|
||||
]}
|
||||
activeTab={"0"}
|
||||
setActiveTab={() => {}}
|
||||
setActiveTab={() => { }}
|
||||
/>
|
||||
) : (
|
||||
<code className={className} {...props}>
|
||||
|
|
@ -245,7 +245,7 @@ export default function ChatMessage({
|
|||
},
|
||||
}}
|
||||
>
|
||||
{chatMessage}
|
||||
{chatMessage===""?EMPTY_INPUT_SEND_MESSAGE:chatMessage}
|
||||
</Markdown>
|
||||
),
|
||||
[chat.message, chatMessage],
|
||||
|
|
@ -274,7 +274,7 @@ export default function ChatMessage({
|
|||
}
|
||||
/>
|
||||
</button>
|
||||
<span className="prose text-primary word-break-break-word dark:prose-invert">
|
||||
<span className={cn("prose word-break-break-word dark:prose-invert",(chatMessage!==""?EMPTY_INPUT_SEND_MESSAGE:chatMessage?"text-primary":"text-chat-trigger-disabled"))}>
|
||||
{promptOpen
|
||||
? template?.split("\n")?.map((line, index) => {
|
||||
const regex = /{([^}]+)}/g;
|
||||
|
|
@ -304,22 +304,22 @@ export default function ChatMessage({
|
|||
}
|
||||
return <p>{parts}</p>;
|
||||
})
|
||||
: chatMessage}
|
||||
: (chatMessage === "" ? EMPTY_INPUT_SEND_MESSAGE : chatMessage)
|
||||
}
|
||||
</span>
|
||||
</>
|
||||
) : (
|
||||
<div className="flex flex-col">
|
||||
<span
|
||||
className={`prose word-break-break-word dark:prose-invert ${
|
||||
chatMessage === EMPTY_INPUT_SEND_MESSAGE
|
||||
? "text-gray-400"
|
||||
className={`prose word-break-break-word dark:prose-invert ${chatMessage === ""
|
||||
? "text-chat-trigger-disabled"
|
||||
: "text-primary"
|
||||
}`}
|
||||
data-testid={
|
||||
"chat-message-" + chat.sender_name + "-" + chatMessage
|
||||
}
|
||||
>
|
||||
{chatMessage}
|
||||
{(chatMessage === "" ? EMPTY_INPUT_SEND_MESSAGE : chatMessage)}
|
||||
</span>
|
||||
{chat.files && (
|
||||
<div className="my-2 flex flex-col gap-5">
|
||||
|
|
|
|||
|
|
@ -80,10 +80,7 @@ export default function ChatView({
|
|||
|
||||
return {
|
||||
isSend: !is_ai,
|
||||
message:
|
||||
(message === "" || !message) && !stream_url && files?.length === 0
|
||||
? EMPTY_INPUT_SEND_MESSAGE
|
||||
: message,
|
||||
message,
|
||||
sender_name,
|
||||
componentId: output.id,
|
||||
stream_url: stream_url,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue