import classNames from 'classnames'; import type { HotkeyAction } from '../../hooks/useHotKey'; import { useFormattedHotkey } from '../../hooks/useHotKey'; import { useOsInfo } from '../../hooks/useOsInfo'; import { HStack } from './Stacks'; interface Props { action: HotkeyAction | null; className?: string; variant?: 'text' | 'with-bg'; } export function HotKey({ action, className, variant }: Props) { const osInfo = useOsInfo(); const labelParts = useFormattedHotkey(action); if (labelParts === null || osInfo == null) { return null; } return ( {labelParts.map((char, index) => (
{char}
))}
); }