"use client" import * as React from 'react' import { Check, ShieldAlert } from 'lucide-react' import { cn } from '@open-mercato/shared/lib/utils' import { useT, useLocale } from '@open-mercato/shared/lib/i18n/context' import type { AgentFactView, GuardCheckView } from './types' import { deriveFactsFromInput, deriveProposedFields, deriveReasoning, resolveDeclaredFacts, type FactSources, type ResolvedFact, } from './proposalFactsData' /** * Real-data panels for a proposal awaiting disposition. `FactsGrid` shows the * case facts behind the proposal — the agent's declared facts (FACTS.json / * defineAgent `facts`) when present, else a generic derivation from the run * input — plus the flat fields of the proposed action itself. `ReasoningList` * shows the persisted rationale(s) and the actual guardrail verdicts. * Sections render nothing when there is no data — no placeholders. */ export function FactsGrid({ facts, sources, className, }: { facts?: AgentFactView[] sources: FactSources className?: string }) { const locale = useLocale() const declared = facts && facts.length > 0 ? resolveDeclaredFacts(facts, sources, locale) : [] const rows = declared.length > 0 ? declared : deriveFactsFromInput(sources.input, locale) if (rows.length === 0) return null return (
{fact.label}
{fact.value}
{t('agent_orchestrator.caseload.inbox.proposed')}
{field.label}
{field.value}
{t('agent_orchestrator.caseload.inbox.reasoning')}