|
1 | 1 | "use client"; |
2 | 2 |
|
3 | 3 | import { useRouter } from "@/components/router"; |
| 4 | +import { getShortcutModifierKeyLabel } from "@/lib/keyboard-shortcuts"; |
4 | 5 | import { cn } from "@/lib/utils"; |
5 | 6 | import { |
6 | 7 | LayoutIcon, |
@@ -118,6 +119,8 @@ const CyclingPlaceholder = memo(function CyclingPlaceholder({ |
118 | 119 | }: { |
119 | 120 | onSelectQuery?: (query: string) => void, |
120 | 121 | }) { |
| 122 | + const modifierKeyLabel = getShortcutModifierKeyLabel(); |
| 123 | + |
121 | 124 | return ( |
122 | 125 | <div className="h-full flex flex-col items-center select-none px-6"> |
123 | 126 | {/* Top spacer */} |
@@ -149,7 +152,9 @@ const CyclingPlaceholder = memo(function CyclingPlaceholder({ |
149 | 152 | <div className="relative text-center mb-4"> |
150 | 153 | {/* Keybind reminder - like tape on the corner */} |
151 | 154 | <span className="absolute -top-4 -right-8 rotate-[30deg] flex items-center gap-0.5 text-[10px] text-muted-foreground/40"> |
152 | | - <kbd className="px-1.5 py-0.5 rounded bg-foreground/[0.06] font-mono">⌘</kbd> |
| 155 | + <kbd suppressHydrationWarning className="px-1.5 py-0.5 rounded bg-foreground/[0.06] font-mono"> |
| 156 | + {modifierKeyLabel} |
| 157 | + </kbd> |
153 | 158 | + |
154 | 159 | <kbd className="px-1.5 py-0.5 rounded bg-foreground/[0.06] font-mono">K</kbd> |
155 | 160 | </span> |
@@ -204,7 +209,9 @@ const CyclingPlaceholder = memo(function CyclingPlaceholder({ |
204 | 209 | {/* Keyboard hints footer */} |
205 | 210 | <div className="py-3 border-t border-foreground/[0.06] w-full flex items-center justify-center gap-5 text-[10px] text-muted-foreground/40"> |
206 | 211 | <div className="flex items-center gap-1.5"> |
207 | | - <kbd className="px-1.5 py-0.5 rounded bg-foreground/[0.06] font-mono">⌘</kbd> |
| 212 | + <kbd suppressHydrationWarning className="px-1.5 py-0.5 rounded bg-foreground/[0.06] font-mono"> |
| 213 | + {modifierKeyLabel} |
| 214 | + </kbd> |
208 | 215 | + |
209 | 216 | <kbd className="px-1.5 py-0.5 rounded bg-foreground/[0.06] font-mono">K</kbd> |
210 | 217 | <span>open</span> |
@@ -999,6 +1006,7 @@ export function CmdKSearch({ |
999 | 1006 | export function CmdKTrigger() { |
1000 | 1007 | const mouseCursorRef = useRef<HTMLDivElement>(null); |
1001 | 1008 | const mouseCursorParentRef = useRef<HTMLDivElement>(null); |
| 1009 | + const modifierKeyLabel = getShortcutModifierKeyLabel(); |
1002 | 1010 |
|
1003 | 1011 | useEffect(() => { |
1004 | 1012 | const handleMouseMove = (e: MouseEvent) => { |
@@ -1058,8 +1066,11 @@ export function CmdKTrigger() { |
1058 | 1066 | Control Center |
1059 | 1067 | </span> |
1060 | 1068 | <div className="pointer-events-none flex items-center gap-1"> |
1061 | | - <kbd className="flex h-5 min-w-[20px] select-none items-center justify-center rounded-md bg-foreground/[0.04] ring-1 ring-inset ring-foreground/[0.06] px-1.5 font-mono text-[10px] font-medium text-muted-foreground/50 group-hover:text-muted-foreground/70 transition-colors duration-300 group-hover:transition-none"> |
1062 | | - ⌘ |
| 1069 | + <kbd |
| 1070 | + suppressHydrationWarning |
| 1071 | + className="flex h-5 min-w-[20px] select-none items-center justify-center rounded-md bg-foreground/[0.04] ring-1 ring-inset ring-foreground/[0.06] px-1.5 font-mono text-[10px] font-medium text-muted-foreground/50 group-hover:text-muted-foreground/70 transition-colors duration-300 group-hover:transition-none" |
| 1072 | + > |
| 1073 | + {modifierKeyLabel} |
1063 | 1074 | </kbd> |
1064 | 1075 | <kbd className="flex h-5 min-w-[20px] select-none items-center justify-center rounded-md bg-foreground/[0.04] ring-1 ring-inset ring-foreground/[0.06] px-1.5 font-mono text-[10px] font-medium text-muted-foreground/50 group-hover:text-muted-foreground/70 transition-colors duration-300 group-hover:transition-none"> |
1065 | 1076 | K |
|
0 commit comments