import { Badge, Card, Loader, Stack, Table, Text, Title } from '@mantine/core'; import { useDataPlan, useScripts } from '../api/hooks'; import { ErrorAlert, StatusBadge } from '../components/common'; const DATA_COLOR: Record = { found: 'teal', not_found: 'red', seeded: 'dark', seed_refused: 'orange', unsupported: 'gray', skipped: 'gray' }; export function RunData({ id }: { id: string }) { const q = useDataPlan(id); if (q.isLoading) return ; if (q.error) return ; const d = q.data!; return ( Recipes ({Object.keys(d.data_refs).length}) Read-only finds via the egress gate; seeding only with SEED_ALLOWED=1 on a test pod; BIP is a stub. RecipeStrategyStatusOutputsNote {Object.values(d.data_refs).map((r) => ( {r.recipe_id}{r.strategy} {r.status} {JSON.stringify(r.outputs)}{r.note} ))}
Case to recipes {Object.entries(d.data_plan).map(([c, rs]) => {c}{rs.join(', ') || no recipe})}
{d.gaps.length > 0 && Gaps: {d.gaps.map((g) => `${g.case_id}/${g.recipe_id}: ${g.reason}`).join('; ')}}
); } export function RunScripts({ id }: { id: string }) { const q = useScripts(id); if (q.isLoading) return ; if (q.error) return ; const rows = Object.values(q.data ?? {}); const yn = (v: boolean | null) => (v === null ? '-' : v ? 'ok' : 'FAIL'); return ( Scripts ({rows.length}): {rows.filter((r) => r.status === 'existing').length} existing, {rows.filter((r) => r.status === 'generated').length} generated drafts CaseStatusPathLintDry-runLast outcome {rows.map((s) => ( {s.case_id}{s.status} {s.path || s.note}{yn(s.lint_ok)}{yn(s.dry_run_ok)} {s.last_outcome} ))}
); }