import { Fragment } from 'react' import { CardContent, KeyboardShortcut, Switch } from 'ui' import { hotkeyToKeys } from '@/state/shortcuts/formatShortcut' import type { ShortcutId } from '@/state/shortcuts/registry' import { useShortcutPreferences } from '@/state/shortcuts/state' import type { ShortcutDefinition } from '@/state/shortcuts/types' import { useIsShortcutEnabled } from '@/state/shortcuts/useIsShortcutEnabled' interface HotkeyToggleProps { definition: ShortcutDefinition isLast?: boolean } export function HotkeyToggle({ definition, isLast }: HotkeyToggleProps) { const enabled = useIsShortcutEnabled(definition.id as ShortcutId) const { setShortcutEnabled } = useShortcutPreferences() return (
{definition.sequence.map((step, i) => ( {i > 0 && then} ))}
setShortcutEnabled(definition.id as ShortcutId, checked)} />
) }