module Web.View.AgentDelegations.Index where import Web.View.Prelude data IndexView = IndexView { delegations :: ![AgentDelegation] } instance View IndexView where html IndexView { .. } = [hsx|

Agent Delegations

{forEach delegations renderRow}
Scope Status Token Budget / Used Created
|] where renderRow d = [hsx| {d.scope} {statusBadge d.status} {show d.tokenBudget} / {maybe "—" show d.tokensUsed} {timeAgo d.createdAt} View |] statusBadge :: Text -> Html statusBadge "completed" = [hsx|completed|] statusBadge "failed" = [hsx|failed|] statusBadge "cancelled" = [hsx|cancelled|] statusBadge _ = [hsx|pending|]