import { Box, Text } from 'ink'; import type { AuditTuiState } from '../audit-state'; import { InboxZeroCelebration } from '../celebration'; import { SEVERITY_VISUALS } from '../icons'; interface Props { state: AuditTuiState; focused: boolean; } export function CategoriesPane({ state, focused }: Props) { const { groups, selectedCategory } = state; return ( 2 Categories {groups.length === 0 ? ( // Don't celebrate while the audit is still running — the // empty report is a placeholder, not a verdict. state.auditing ? ( (checking…) ) : ( ) ) : ( groups.map((g) => { const v = SEVERITY_VISUALS[g.severity]; const isSelected = focused && g.category === selectedCategory; // When selected, render the whole row as a single inverse // Text — nested children override the parent's // inverse styling in Ink's renderer, so we flatten. if (isSelected) { return ( {`▸ ${v.icon} ${v.label} · ${g.category} (${g.findings.length})`} ); } return ( {' '} {v.icon} {v.label} {` · ${g.category} (${g.findings.length})`} ); }) )} ); }