Files
yaak/src-web/components/core/HotKey.tsx
Gregory Schier b2524c1de0 A bunch of tweaks
2023-04-06 16:05:25 -07:00

22 lines
406 B
TypeScript

import classnames from 'classnames';
interface Props {
modifier: 'Meta' | 'Control' | 'Shift';
keyName: string;
}
const keys: Record<Props['modifier'], string> = {
Control: '⌃',
Meta: '⌘',
Shift: '⇧',
};
export function HotKey({ modifier, keyName }: Props) {
return (
<span className={classnames('text-sm text-gray-600')}>
{keys[modifier]}
{keyName}
</span>
);
}