-
-
Save jetaggart/e4cb88fbb40a72ab5376f96161a4034f to your computer and use it in GitHub Desktop.
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
// frontend/src/SalesChat.js:7 | |
function SalesChat({ username, leadId, chatClient, channel }) { | |
async function handleMessage(_channelId, message) { | |
await axios.post("http://localhost:8080/messages", { message, author: username, leadId: leadId }); | |
return channel.sendMessage(message); | |
} | |
return ( | |
<Chat client={chatClient} theme="commerce light"> | |
<Channel channel={channel} doSendMessageRequest={handleMessage}> | |
<Window> | |
<h1> | |
Customer Support Chat: {channel.id} | |
</h1> | |
<MessageList/> | |
<MessageInput focus/> | |
</Window> | |
</Channel> | |
</Chat> | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment