import { useMemo } from "react"; import { keyboard } from "@/lib/keyboard"; import { Kbd } from "@/ui/misc"; import { t, tNode } from "@/lib/i18n"; export function ShortcutsSettings() { const list = useMemo(() => keyboard.list(), []); const groups = useMemo(() => { const g = new Map(); for (const b of list) { const arr = g.get(b.group) ?? []; arr.push(b); g.set(b.group, arr); } return [...g.entries()]; }, [list]); return (

{t("Keyboard shortcuts")}

{tNode("Gmail-style shortcuts are always on. Press {key} anywhere to see this list.", { key: ? })}

{groups.map(([group, items]) => (

{group}

{items.map((b) => (
{b.description}
))}
))} {!groups.length &&

{t("Open the Mail view to see all shortcuts.")}

}
); }