import { Box, Text } from "ink"; import { HELP_GROUPS } from "../keymap"; import { useStore } from "../store"; import { COLOR, RULE, lerpHex } from "../theme"; const CARD_BORDER = lerpHex(COLOR.accent, RULE, 0.55); const KEY_GAP = 2; const COL_GAP = 2; const KEY_W = HELP_GROUPS.map( (g) => Math.max(...g.hints.map((h) => h.keys.length)) + KEY_GAP, ); const COL_W = HELP_GROUPS.map( (g, i) => KEY_W[i]! + Math.max(...g.hints.map((h) => h.label.length)), ); const CARD_W = COL_W.reduce((a, b) => a + b, 0) + (HELP_GROUPS.length - 1) * COL_GAP + 4; const KEY_W_STACKED = Math.max(...KEY_W); export function HelpOverlay() { const { cols } = useStore(); const columns = cols >= CARD_W; return ( Keyboard {HELP_GROUPS.map((group, gi) => ( 0 ? 1 : 0} > {group.title} {group.hints.map((h) => ( {h.keys} {h.label} ))} ))} Your downloaded files always stay on disk. Press ? or esc to close ); }