import { Badge } from "../components/ui/badge"; import { MarkdownView } from "./MarkdownView"; import { statusBadgeClass } from "./statusBadge"; import { phaseOpenQuestionText, type PhaseCheck, type PhaseSection, type PhaseSectionItem, type PhaseSummaryV2, type PhaseTable, } from "./artifactV2"; const CODE_CHIP = "rounded-md bg-muted px-1.5 py-0.5 font-mono text-xs text-foreground/90"; function Check({ check }: { check: PhaseCheck }) { return (
{check.status}
{check.label} {check.detail && {check.detail}}
); } function SectionItemRow({ item }: { item: PhaseSectionItem }) { const tableColumn = item.table && item.column ? `${item.table}.${item.column}` : item.table ?? item.column; return (
{item.label} {tableColumn && {tableColumn}} {item.value && {item.value}}
{item.description &&

{item.description}

} {item.rationale &&

{item.rationale}

}
); } function Section({ section }: { section: PhaseSection }) { return (

{section.title}

{(section.items ?? []).map((item, i) => ( ))}
); } function TableRecap({ table }: { table: PhaseTable }) { return (
{table.name} {table.role}
{table.description &&

{table.description}

} {table.columns && table.columns.length > 0 && (
{table.columns.map((c) => (
{c.name} {c.description && {c.description}} {c.value_filter && {c.value_filter}}
))}
)}
); } export function PhaseSummaryViewer({ phase }: { phase: PhaseSummaryV2 }) { const openQuestions = Array.isArray(phase.open_questions) ? (phase.open_questions as unknown[]) .map(phaseOpenQuestionText) .filter((question): question is string => question !== null) : []; return (

{phase.phase.id} — {phase.phase.name}

{phase.summary && } {phase.checks && phase.checks.length > 0 && (
{phase.checks.map((c, i) => ( ))}
)} {phase.sections && phase.sections.length > 0 && (
{phase.sections.map((s, i) => (
))}
)} {phase.tables && phase.tables.length > 0 && (
{phase.tables.map((t) => ( ))}
)} {openQuestions.length > 0 && (

Open questions

    {openQuestions.map((q, i) => (
  • {q}
  • ))}
)}
); }