|
|
|
@ -10,14 +10,14 @@ const InputBox = observer(({ onSend }) => {
|
|
|
|
|
onSend(v);
|
|
|
|
|
setMessage('');
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
const sendMessage = async () => {
|
|
|
|
|
if (message.trim() !== '') {
|
|
|
|
|
// const api = new RealTimeAPI('wss://your_rocket_chat_server_url/websocket');
|
|
|
|
|
// await api.login('your_username', 'your_password'); // replace with your actual username and password
|
|
|
|
|
// await api.sendMessage({ roomId: 'ROOM_ID', msg: message }); // replace 'ROOM_ID' with your actual room id
|
|
|
|
|
setMessage('');
|
|
|
|
|
}
|
|
|
|
|
if (message.trim() !== '') {
|
|
|
|
|
// const api = new RealTimeAPI('wss://your_rocket_chat_server_url/websocket');
|
|
|
|
|
// await api.login('your_username', 'your_password'); // replace with your actual username and password
|
|
|
|
|
// await api.sendMessage({ roomId: 'ROOM_ID', msg: message }); // replace 'ROOM_ID' with your actual room id
|
|
|
|
|
setMessage('');
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
@ -26,7 +26,7 @@ const InputBox = observer(({ onSend }) => {
|
|
|
|
|
<Button type="primary" className="chat-button">
|
|
|
|
|
Send
|
|
|
|
|
</Button> */}
|
|
|
|
|
<Input.Search placeholder='Type message here' enterButton='Send' size='large' onSearch={handleSend} defaultValue={message} />
|
|
|
|
|
<Input.Search placeholder='Type message here' enterButton='Send' size='large' onSearch={handleSend} value={message} onChange={(e) => setMessage(e.target.value)} />
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|