fix: add typing indicator back when waiting for response
This commit is contained in:
@@ -6,6 +6,7 @@
|
|||||||
interface Props {
|
interface Props {
|
||||||
bot: Bot | null;
|
bot: Bot | null;
|
||||||
messages: ChatMessage[];
|
messages: ChatMessage[];
|
||||||
|
isSending?: boolean;
|
||||||
onSendMessage: (message: string) => void;
|
onSendMessage: (message: string) => void;
|
||||||
onSelectBot?: (botId: string) => void;
|
onSelectBot?: (botId: string) => void;
|
||||||
availableBots?: Bot[];
|
availableBots?: Bot[];
|
||||||
@@ -15,6 +16,7 @@
|
|||||||
let {
|
let {
|
||||||
bot,
|
bot,
|
||||||
messages,
|
messages,
|
||||||
|
isSending = false,
|
||||||
onSendMessage,
|
onSendMessage,
|
||||||
onSelectBot,
|
onSelectBot,
|
||||||
availableBots = [],
|
availableBots = [],
|
||||||
@@ -132,6 +134,18 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{/each}
|
{/each}
|
||||||
|
|
||||||
|
{#if isSending}
|
||||||
|
<div class="message assistant">
|
||||||
|
<div class="message-content">
|
||||||
|
<div class="typing">
|
||||||
|
<span class="dot"></span>
|
||||||
|
<span class="dot"></span>
|
||||||
|
<span class="dot"></span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{#if bot}
|
{#if bot}
|
||||||
|
|||||||
@@ -109,6 +109,7 @@
|
|||||||
<ChatInterface
|
<ChatInterface
|
||||||
bot={$currentBotStore}
|
bot={$currentBotStore}
|
||||||
messages={$chatStore}
|
messages={$chatStore}
|
||||||
|
isSending={isSending}
|
||||||
onSendMessage={handleSendMessage}
|
onSendMessage={handleSendMessage}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user