A bunch of tweaks

This commit is contained in:
Gregory Schier
2023-04-06 16:05:25 -07:00
parent 0b3bd6313f
commit b2524c1de0
16 changed files with 110 additions and 101 deletions

View File

@@ -1,15 +1,21 @@
import classnames from 'classnames';
import type { HTMLAttributes } from 'react';
export function HotKey({ children }: HTMLAttributes<HTMLSpanElement>) {
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(
'bg-highlightSecondary bg-opacity-20 px-1.5 py-0.5 rounded text-sm',
'font-mono text-gray-500 tracking-widest',
)}
>
{children}
<span className={classnames('text-sm text-gray-600')}>
{keys[modifier]}
{keyName}
</span>
);
}