module Web.View.ApiConsumers.Show where import Web.Types import Generated.Types import IHP.Prelude import IHP.ViewPrelude import Web.Routes () data ShowView = ShowView { consumer :: !ApiConsumer , apiKeys :: ![ApiKey] , webhooks :: ![WebhookSubscription] , mManifest :: !(Maybe HubCapabilityManifest) } instance View ShowView where html ShowView { .. } = [hsx|
{d}
|] Nothing -> mempty manifestPanel = case mManifest of Nothing -> mempty Just m -> [hsx|| Prefix | Type | Scopes | Expires | Status |
|---|
| Event Type | Target URL | Status |
|---|
No keys yet.
|] noWebhooksMsg :: Html noWebhooksMsg = [hsx|No webhooks yet.
|] renderWebhookStatus :: Bool -> Html renderWebhookStatus True = [hsx|active|] renderWebhookStatus False = [hsx|paused|] renderConsumerStatusDetail :: Bool -> Html renderConsumerStatusDetail True = [hsx|active|] renderConsumerStatusDetail False = [hsx|inactive|] renderKeyStatus :: Bool -> Html renderKeyStatus True = [hsx|revoked|] renderKeyStatus False = [hsx|active|] renderRevokeLink :: ApiKey -> Html renderRevokeLink k | isNothing k.revokedAt = [hsx|Revoke|] | otherwise = mempty