module Web.View.CollectiveProposals.Index where
import Web.View.Prelude
data IndexView = IndexView
{ proposals :: ![CollectiveProposal] }
instance View IndexView where
html IndexView { .. } = [hsx|
Collective Proposals
| Title |
Task Type |
Consensus |
Created |
|
{forEach proposals renderRow}
|]
where
renderRow p = [hsx|
| {p.title} |
{p.taskType} |
{consensusBadge p.consensusStatus} |
{timeAgo p.createdAt} |
View
|
|]
consensusBadge :: Text -> Html
consensusBadge "consensus" = [hsx|consensus|]
consensusBadge "divergent" = [hsx|divergent|]
consensusBadge _ = [hsx|pending|]