Files
yaak/src-web/components/core/HotKey.tsx
2023-10-25 11:13:00 -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>
);
}