module Web.View.CollectiveProposals.Show where import Web.View.Prelude import Web.View.CollectiveProposals.Index (consensusBadge) data ShowView = ShowView { proposal :: !CollectiveProposal , agentContributions :: ![(CollectiveProposalContribution, Text)] -- ^ (contribution, agent name) } instance View ShowView where html ShowView { .. } = [hsx|

{proposal.title}

{proposal.taskType}

{consensusBadge proposal.consensusStatus}
{case proposal.summary of Nothing -> mempty Just s -> [hsx|

{s}

|]} {case proposal.finalContent of Nothing -> mempty Just fc -> [hsx|

Synthesized Recommendation

{show fc}
|]}

Agent Contributions ({show (length agentContributions)})

{forEach agentContributions renderContrib}
|] where renderContrib (contrib, agentName) = [hsx|
{agentName} {maybe "" (\m -> "model: " <> m) contrib.modelUsed} {maybe "" (\t -> " ยท " <> show t <> " tokens out") contrib.tokensOut}
{show contrib.content}
|]