module Web.View.InteractionReportingContracts.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 :: ![InteractionReportingContract] } instance View IndexView where html IndexView { .. } = [hsx|

Interaction Reporting Contracts

Defines the REST endpoint and payload schema for external adapter event submission.

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

No contracts found.

|] renderTable :: [InteractionReportingContract] -> Html renderTable contracts = [hsx|
{forEach contracts renderRow}
Version Endpoint Auth Status Created
|] renderRow :: InteractionReportingContract -> Html renderRow c = [hsx| v{c.contractVersion} {c.endpointPath} {c.authScheme} " text-xs px-2 py-0.5 rounded font-medium"}> {c.status} {show c.createdAt} |]