export type KeyName = "mod" | "shift" | "enter"; const MAC_LABELS: Record = { mod: "⌘", shift: "⇧", enter: "⏎" }; const LABELS: Record = { mod: "Ctrl", shift: "Shift", enter: "Enter" }; export const isMac = (): boolean => /Mac|iPhone|iPad/.test(navigator.platform); export const keyLabel = (key: KeyName, mac: boolean): string => (mac ? MAC_LABELS : LABELS)[key];