From 1595e0210a7911f12d425a02c834a0d7a2b26a7b Mon Sep 17 00:00:00 2001 From: ManishMadan2882 Date: Fri, 22 Nov 2024 17:55:37 +0530 Subject: [PATCH] (fix:search) change toolkit info --- .../react-widget/src/components/SearchBar.tsx | 29 +++++++++++++++---- 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/extensions/react-widget/src/components/SearchBar.tsx b/extensions/react-widget/src/components/SearchBar.tsx index 7fd44c730..aff036d07 100644 --- a/extensions/react-widget/src/components/SearchBar.tsx +++ b/extensions/react-widget/src/components/SearchBar.tsx @@ -236,7 +236,13 @@ export const SearchBar = ({ return 'ontouchstart' in window; } const isTouch = isTouchDevice(); - + const getKeyboardInstruction = () => { + if (isResultVisible) return "Enter" + if (browserOS === 'mac') + return "⌘ K" + else + return "Ctrl K" + } React.useEffect(() => { const handleFocusSearch = (event: KeyboardEvent) => { if ( @@ -361,11 +367,22 @@ export const SearchBar = ({ ) } - { - setIsWidgetOpen(true) - }} title={`${isTouch ? "Tap" : "Press Enter"} to Ask the AI`}> - {isTouch ? "Tap" : "Enter"} - + { + isTouch ? + + { + setIsWidgetOpen(true) + }} + title={"Tap to Ask the AI"}> + Tap + + : + + {getKeyboardInstruction()} + + }