forked from langflow-ai/langflow-embedded-chat
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
changed way of getting response to show message if only has one response
- Loading branch information
1 parent
b75dc13
commit 054b2d7
Showing
5 changed files
with
275 additions
and
155 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,39 @@ | ||
import { ChatMessageType } from "../../../types/chatWidget"; | ||
import { MoreHorizontal } from 'lucide-react'; | ||
import { MoreHorizontal } from "lucide-react"; | ||
|
||
export default function ChatMessage({ message, isSend, error, user_message_style, bot_message_style, error_message_style }: ChatMessageType) { | ||
return ( | ||
<div className={"cl-chat-message " + (isSend ? " cl-justify-end" : " cl-justify-start")}> | ||
{isSend ? | ||
<div style={user_message_style} className="cl-user_message">{message}</div> : | ||
error ? <div style={error_message_style} className={"cl-error_message"}> | ||
{message} | ||
</div> : | ||
<div style={bot_message_style} className={"cl-bot_message"}> | ||
{message === "" ? <div className="cl-animate-pulse"><MoreHorizontal/></div> : message} | ||
</div>} | ||
</div>) | ||
} | ||
export default function ChatMessage({ | ||
message, | ||
isSend, | ||
error, | ||
user_message_style, | ||
bot_message_style, | ||
error_message_style, | ||
}: ChatMessageType) { | ||
return ( | ||
<div | ||
className={ | ||
"cl-chat-message " + (isSend ? " cl-justify-end" : " cl-justify-start") | ||
} | ||
> | ||
{isSend ? ( | ||
<div style={user_message_style} className="cl-user_message"> | ||
{message} | ||
</div> | ||
) : error ? ( | ||
<div style={error_message_style} className={"cl-error_message"}> | ||
{message} | ||
</div> | ||
) : ( | ||
<div style={bot_message_style} className={"cl-bot_message"}> | ||
{message === "" ? ( | ||
<div className="cl-animate-pulse"> | ||
<MoreHorizontal /> | ||
</div> | ||
) : ( | ||
message | ||
)} | ||
</div> | ||
)} | ||
</div> | ||
); | ||
} |
Oops, something went wrong.