import { useQuery } from '@tanstack/react-query'; import { ArrowRight, Sparkles, TrendingUp } from 'lucide-react'; interface CapabilityProposal { id: string; title: string; description: string; targetAgent: string; priority: string; status: string; impactArea?: string; estimatedEffort?: string; } interface ProposalsResponse { proposals: CapabilityProposal[]; total: number; } const PRIORITY_COLOR: Record = { P0: '#ef4444', P1: '#f59e0b', P2: '#3b82f6', P3: '#6b7280', }; const STATUS_LABEL: Record = { new: 'New', in_progress: 'In Review', approved: 'Approved', deployed: 'Live', rejected: 'Rejected', }; async function fetchProposals(): Promise { const res = await fetch('/api/helios/proposals?status=new,in_progress&limit=4'); if (!res.ok) return []; const data: ProposalsResponse = await res.json(); return data.proposals ?? []; } export function HeliosProposalsInbox() { const { data: proposals = [], isLoading } = useQuery({ queryKey: ['helios-proposals-inbox'], queryFn: fetchProposals, staleTime: 60_000, retry: false, }); return (
HELIOS Capability Proposals
Open HELIOS
{isLoading ? (
{[0, 1, 2].map((i) => (
))}
) : proposals.length === 0 ? (

No pending proposals from HELIOS

) : (
{proposals.map((p) => { const color = PRIORITY_COLOR[p.priority] ?? '#6b7280'; return (

{p.title}

{STATUS_LABEL[p.status] ?? p.status}
{p.targetAgent} {p.impactArea && ( <> · {p.impactArea} )} {p.estimatedEffort && ( <> · {p.estimatedEffort} )}
{p.priority}
); })}
)}
); }