module Web.View.InteractionReportingContracts.Show where import Web.Types import Generated.Types import IHP.Prelude import IHP.ViewPrelude import Web.Routes () import Application.Helper.View (adapterStatusBadge) data ShowView = ShowView { contract :: !InteractionReportingContract } instance View ShowView where html ShowView { .. } = [hsx|
{contract.endpointPath}
{contract.authScheme}{tshow contract.requiredFields}
{tshow contract.acceptedEventTypes}
curl -X POST {contract.endpointPath} \
-H "Authorization: Bearer <hub-api-key>" \
-H "Content-Type: application/json" \
-d '{
"widget_id": "<uuid>",
"hub_id": "<uuid>",
"event_type": "clicked",
"occurred_at": "2026-03-29T12:00:00Z"
}'
{d}
|] contractDescription :: InteractionReportingContract -> [Text] contractDescription c = case c.description of Just d -> [d] Nothing -> [] maturityBadge :: Text -> Html maturityBadge "stable" = [hsx|Stable|] maturityBadge "beta" = [hsx|Beta|] maturityBadge "experimental" = [hsx|Experimental|] maturityBadge "deprecated" = [hsx|Deprecated|] maturityBadge m = [hsx|{m}|]