/** * Single global footer — shortcuts + transient action status (no own border; * the app chrome already frames the shell). */ import { Box, Text } from "ink"; import type { ReactElement } from "react"; import { Spinner } from "./Spinner.tsx"; import { TUI_HINT, TUI_MUTED, TUI_OK } from "../theme.ts"; /** Footer mode. */ export type FooterStatus = | { readonly kind: "idle" } | { readonly kind: "running"; readonly label: string } | { readonly kind: "done"; readonly label?: string }; /** Props for {@link StatusBar}. */ export type StatusBarProps = { readonly status?: FooterStatus; readonly hints?: string; }; /** * Shortcut strip + optional running/done feedback. * * @param props - Status + hints */ export function StatusBar(props: StatusBarProps): ReactElement { const hints = props.hints ?? "/ command · Tab panels · ↑↓ navigate · Enter action · 1-5 jump · Esc"; const status = props.status ?? { kind: "idle" as const }; return ( {status.kind === "running" ? ( ) : status.kind === "done" ? ( ✓ {status.label ?? "Done"} ) : ( {hints} )} {status.kind !== "idle" ? ( {hints} ) : null} ); }