import { Box, Text } from 'ink'; import Spinner from 'ink-spinner'; import { ALL_CATEGORIES, CATEGORY_LABELS, type CategoryStatus } from '../audit-state'; import type { Theme } from '../theme'; interface Props { progress: Record; theme: Theme; } /** * Right-padded label so all the verdict icons line up vertically * regardless of category-name length. 21 = longest label * ("Unconfigured modules") + a couple of cells of cushion. */ const LABEL_WIDTH = 22; function StatusRow({ category, status }: { category: string; status: CategoryStatus }) { const label = CATEGORY_LABELS[category as keyof typeof CATEGORY_LABELS] ?? category; const padded = label.padEnd(LABEL_WIDTH, ' '); if (status === 'pending') { return · {padded} pending; } if (status === 'running') { return ( {padded} checking… ); } // done if (status.verdict === 'clean') { return ✓ {padded}clean; } if (status.verdict === 'unmeasured') { return ? {padded}unmeasured; } if (status.verdict === 'drift') { return ▲ {padded}drift; } return × {padded}blocked; } /** * Pops at the start of every audit run — one fuel-gauge per * category. Auto-dismisses (via the reducer) when every category * reports done. Non-interactive: nothing for the user to do here * besides wait. Ctrl-C / q still quit at the AuditTui level. */ export function AnalyzingModal({ progress, theme }: Props) { return ( Analyzing system… {ALL_CATEGORIES.map((c) => ( ))} q to quit ); }