Skip to content

Commit 04206fb

Browse files
committed
chore(*): fix lint
1 parent e002594 commit 04206fb

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

stories/chat.stories.ts

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -384,10 +384,20 @@ async function handleAIMessageSend(e: CustomEvent) {
384384
}, 2000);
385385
}
386386

387-
function handleMessageReacted() {
388-
// e: CustomEvent
389-
// const { message, reaction } = e.detail;
390-
// console.log('Message reacted:', message, 'Reaction:', reaction);
387+
function handleMessageReacted(e: CustomEvent) {
388+
const chat = document.querySelector('igc-chat');
389+
if (!chat) {
390+
return;
391+
}
392+
393+
const { message, reaction } = e.detail;
394+
const botResponse: IgcMessage = {
395+
id: Date.now().toString(),
396+
text: `Reacted with '${reaction}' to: '${message.text}'`,
397+
sender: 'bot',
398+
timestamp: new Date(),
399+
};
400+
chat.messages = [...chat.messages, botResponse];
391401
}
392402

393403
export const Basic: Story = {

0 commit comments

Comments
 (0)