module Web.View.EnvelopeEmissionContracts.Index where import Web.Types import Generated.Types import IHP.Prelude import IHP.ViewPrelude import Web.Routes () import Application.Helper.View (adapterStatusBadge) data IndexView = IndexView { contracts :: ![EnvelopeEmissionContract] } instance View IndexView where html IndexView { .. } = [hsx|

Envelope Emission Contracts

Formalises which data-* attributes every widget envelope must emit.

→ Reporting Contracts
{if null contracts then noContractsMsg else renderTable contracts} |] noContractsMsg :: Html noContractsMsg = [hsx|

No contracts found.

|] renderTable :: [EnvelopeEmissionContract] -> Html renderTable contracts = [hsx|
{forEach contracts renderRow}
Version Required Attributes Status Created
|] renderRow :: EnvelopeEmissionContract -> Html renderRow c = [hsx| v{c.contractVersion} {tshow c.requiredAttributes} " text-xs px-2 py-0.5 rounded font-medium"}> {c.status} {show c.createdAt} |]