mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-02-24 08:34:56 +01:00
21 lines
556 B
TypeScript
21 lines
556 B
TypeScript
import classNames from 'classnames';
|
|
import type { HotkeyAction } from '../../hooks/useHotkey';
|
|
import { useFormattedHotkey } from '../../hooks/useHotkey';
|
|
import { useOsInfo } from '../../hooks/useOsInfo';
|
|
|
|
interface Props {
|
|
action: HotkeyAction | null;
|
|
}
|
|
|
|
export function HotKey({ action }: Props) {
|
|
const osinfo = useOsInfo();
|
|
const label = useFormattedHotkey(action);
|
|
if (label === null || osinfo == null) {
|
|
return null;
|
|
}
|
|
|
|
return (
|
|
<span className={classNames('text-sm text-gray-1000 text-opacity-disabled')}>{label}</span>
|
|
);
|
|
}
|