module Web.View.AgentDelegations.Show where import Web.View.Prelude import Web.View.AgentDelegations.Index (statusBadge) data ShowView = ShowView { delegation :: !AgentDelegation , delegatingAgent :: !AgentRegistration , receivingAgent :: !AgentRegistration , mParentProposal :: !(Maybe AgentProposal) } instance View ShowView where html ShowView { .. } = [hsx|

Delegation

{statusBadge delegation.status}

Delegating Agent

{delegatingAgent.name}

Receiving Agent

{receivingAgent.name}

Scope

{delegation.scope}

Token Budget

{show delegation.tokenBudget}

Tokens Used

{maybe "—" show delegation.tokensUsed}

{case mParentProposal of Nothing -> mempty Just p -> [hsx|

Parent Proposal

{p.proposalType} — {p.status}

|]} {case delegation.result of Nothing -> mempty Just r -> [hsx|

Result

{show r}
|]}
|]