Skip to content

Commit 0030c97

Browse files
author
Bogdan Tsechoev
committed
Merge branch 'bot_ui_floating_intercom' into 'master'
Bot UI: Floating intercom See merge request postgres-ai/database-lab!873
2 parents e4dc939 + bdb5d1c commit 0030c97

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

ui/packages/platform/src/pages/Bot/Command/Command.tsx

+7
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import { theme } from "@postgres.ai/shared/styles/theme";
1616
import { isMobileDevice } from "../../../utils/utils";
1717
import { useAiBot } from "../hooks";
1818
import { ReadyState } from "react-use-websocket";
19+
import { useFloatingIntercom } from "../../../hooks/useFloatingIntercom";
1920

2021

2122
type Props = {
@@ -193,6 +194,11 @@ export const Command = React.memo((props: Props) => {
193194
setValue('')
194195
}, [threadId]);
195196

197+
// Floating intercom.
198+
const sendButtonRef = useRef<HTMLButtonElement | null>(null)
199+
200+
useFloatingIntercom(sendButtonRef)
201+
196202
return (
197203
<div className={classes.root}>
198204
<TextField
@@ -216,6 +222,7 @@ export const Command = React.memo((props: Props) => {
216222
onClick={triggerSend}
217223
className={classes.iconButton}
218224
disabled={sendDisabled || value.length === 0}
225+
ref={sendButtonRef}
219226
>
220227
<SendRoundedIcon />
221228
</IconButton>

0 commit comments

Comments
 (0)