Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.
Mirrored from https://github.com/Camo67/composio.git
Synced Nov 22, 08:15 UTC
docs: show platform-aware keyboard shortcut hint (⌘/Ctrl)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sushmithamallesh committed
Feb 19, 2026 at 16:05 UTC
9e30fc82efc82d2cd1392f0e11173f5dc3db9f44
1 file changed
+11
-2
docs/components/ask-ai-button.tsx
+11
-2
@@ -1,6 +1,6 @@
1
'use client';
2
3
-import { useEffect } from 'react';
3
+import { useEffect, useState } from 'react';
4
import { Search, MessageSquare } from 'lucide-react';
5
import { useSearchContext } from '@fumadocs/ui/contexts/search';
6
import { useI18n } from '@fumadocs/ui/contexts/i18n';
@@ -24,6 +24,14 @@ function openDecimalWidget() {
24
launcher?.click();
25
}
26
27
+function useIsMac() {
28
+ const [isMac, setIsMac] = useState(true);
29
+ useEffect(() => {
30
+ setIsMac(navigator.platform.toUpperCase().includes('MAC'));
31
+ }, []);
32
+ return isMac;
33
+}
34
+
35
function useAskAIShortcut() {
36
useEffect(() => {
37
function handleKeyDown(e: KeyboardEvent) {
@@ -42,6 +50,7 @@ export function SearchAndAskAI() {
50
const { enabled, hotKey, setOpenSearch } = useSearchContext();
51
const { text } = useI18n();
52
useAskAIShortcut();
53
+ const isMac = useIsMac();
54
55
return (
56
<>
@@ -70,7 +79,7 @@ export function SearchAndAskAI() {
79
>
80
Ask AI
81
<div className="hidden xl:inline-flex gap-0.5">
73
- <kbd className="rounded-md border bg-fd-background px-1.5">⌘</kbd>
82
+ <kbd className="rounded-md border bg-fd-background px-1.5">{isMac ? '⌘' : 'Ctrl'}</kbd>
83
<kbd className="rounded-md border bg-fd-background px-1.5">I</kbd>
84
</div>
85
</button>