import { useModifierPressed } from "@client/hooks/useModifierPressed"; import type React from "react"; interface KbdHintProps { /** The key to display, e.g. "s", "Cmd+K", "?" */ shortcut: string; /** Additional className */ className?: string; } /** * Inline keyboard-hint badge for action buttons. * * Rendered as a small `` element styled to look like a physical key cap. * Hidden on mobile (below `lg` breakpoint) since keyboard shortcuts are only * useful with a physical keyboard. * * Only visible when the Control key is held down. */ export const KbdHint: React.FC = ({ shortcut, className }) => { const isControlPressed = useModifierPressed("Control"); if (!isControlPressed) return null; return ( {shortcut} ); };