/** Shared chips + labels for the Launch Readiness UI. */ import Box from '@mui/material/Box'; import Chip from '@mui/material/Chip'; import Tooltip from '@mui/material/Tooltip'; import Typography from '@mui/material/Typography'; import type { EvidenceStatus, PolicyOutcome, Severity } from '../../types/agentic'; export const SEVERITY_COLORS: Record = { S0: '#455a64', S1: '#546e7a', S2: '#f9a825', S3: '#ef6c00', S4: '#d84315', S5: '#b71c1c', }; export const OUTCOME_STYLE: Record = { AUTOMATIC_STOP_SHIP: { bg: '#b71c1c', fg: '#fff', label: 'AUTOMATIC STOP-SHIP' }, LAUNCH_REVIEW_REQUIRED: { bg: '#e65100', fg: '#fff', label: 'LAUNCH REVIEW REQUIRED' }, CONTINUE_INVESTIGATION: { bg: '#0d47a1', fg: '#90caf9', label: 'CONTINUE INVESTIGATION' }, NO_LAUNCH_IMPACT: { bg: '#1b5e20', fg: '#a5d6a7', label: 'NO LAUNCH IMPACT' }, INDETERMINATE: { bg: '#4a148c', fg: '#ce93d8', label: 'INDETERMINATE (FAIL-SAFE)' }, }; export const EVIDENCE_STATUS_COLORS: Record = { OBSERVED: '#2e7d32', DERIVED: '#0277bd', HYPOTHESIS: '#f9a825', UNAVAILABLE: '#757575', }; export function SeverityChip({ severity }: { severity: Severity | null | undefined }) { if (!severity) return ; return ( ); } export function OutcomeChip({ outcome }: { outcome: PolicyOutcome | null | undefined }) { if (!outcome) return ; const s = OUTCOME_STYLE[outcome]; return ( ); } export function EvidenceStatusChip({ status }: { status: EvidenceStatus }) { return ( ); } /** Marks a value as AI analysis (advisory) vs a deterministic measurement. */ export function OriginBadge({ origin }: { origin: 'ai' | 'deterministic' }) { const isAi = origin === 'ai'; return ( ); } export function PanelTitle({ title, origin, extra, }: { title: string; origin?: 'ai' | 'deterministic'; extra?: React.ReactNode; }) { return ( {title} {origin ? : null} {extra} ); } export function KV({ k, v, mono }: { k: string; v: React.ReactNode; mono?: boolean }) { return ( {k} {v} ); } export const fmtRate = (r: number | null | undefined): string => r === null || r === undefined ? '—' : r === 0 ? '0' : r.toExponential(3); export const fmtCi = (ci: number[] | null | undefined): string => ci && ci.length === 2 ? `[${fmtRate(ci[0])}, ${fmtRate(ci[1])}]` : '—';