import React from 'react'; import { useApi } from '../hooks/useApi'; import { getMeshDelegations, type MeshDelegation } from '../api/delegations'; export default function DelegationLog() { const query = useApi(() => getMeshDelegations({ limit: 50 }), []); const delegations = query.data?.delegations ?? []; const statusColor = (status: string) => { if (status === 'success') return '#16a34a'; if (status === 'error') return '#dc2626'; return '#d97706'; }; return (
Loading...
} {query.error &&Error: {query.error}
} {!query.loading && delegations.length === 0 && (No delegations recorded yet. Delegations appear here when agents delegate tasks to each other via the mesh.
)} {delegations.map((d) => ({d.task}
{d.error &&Error: {d.error}
}