File tree 1 file changed +7
-0
lines changed
ui/packages/platform/src/pages/Bot/Command
1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ import { theme } from "@postgres.ai/shared/styles/theme";
16
16
import { isMobileDevice } from "../../../utils/utils" ;
17
17
import { useAiBot } from "../hooks" ;
18
18
import { ReadyState } from "react-use-websocket" ;
19
+ import { useFloatingIntercom } from "../../../hooks/useFloatingIntercom" ;
19
20
20
21
21
22
type Props = {
@@ -193,6 +194,11 @@ export const Command = React.memo((props: Props) => {
193
194
setValue ( '' )
194
195
} , [ threadId ] ) ;
195
196
197
+ // Floating intercom.
198
+ const sendButtonRef = useRef < HTMLButtonElement | null > ( null )
199
+
200
+ useFloatingIntercom ( sendButtonRef )
201
+
196
202
return (
197
203
< div className = { classes . root } >
198
204
< TextField
@@ -216,6 +222,7 @@ export const Command = React.memo((props: Props) => {
216
222
onClick = { triggerSend }
217
223
className = { classes . iconButton }
218
224
disabled = { sendDisabled || value . length === 0 }
225
+ ref = { sendButtonRef }
219
226
>
220
227
< SendRoundedIcon />
221
228
</ IconButton >
You can’t perform that action at this time.
0 commit comments