Skip to content

Commit

Permalink
chore: add thinking text
Browse files Browse the repository at this point in the history
  • Loading branch information
Selflocking committed Jan 22, 2024
1 parent d84dbf7 commit 6c127db
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions web/src/components/AIAssistant.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ const UserMessage = ({ message }) => {
);
};

const ShowMessages = ({ messages }) => {
// console.log(messages);
const ShowMessages = ({ messages, thinking = false }) => {
return (
<div className="flex flex-col flex-grow p-4 overflow-y-auto">
{messages.map((message) => {
Expand All @@ -50,6 +49,7 @@ const ShowMessages = ({ messages }) => {
return <UserMessage message={message.content} key={message.key} />;
}
})}
{thinking && <AIMessage message="thinking..." />}
</div>
);
};
Expand Down Expand Up @@ -93,7 +93,7 @@ const AIAssistant = () => {
<div className="flex flex-row justify-between items-center p-4 border-b border-gray-300">
<div className="text-lg font-bold">AI小助手</div>
</div>
<ShowMessages messages={messages} />
<ShowMessages messages={messages} thinking={!canSand} />
<div className="flex flex-row justify-between items-center ml-8 mr-8 mb-4">
<Button type="primary" shape="circle" icon={<UndoOutlined />} />
<TextArea
Expand Down

0 comments on commit 6c127db

Please sign in to comment.