module Web.View.HubRoutingRules.Show where import Web.View.Prelude import Web.Routes () import Web.View.HubRoutingRules.Index (statusBadge) data ShowView = ShowView { rule :: !HubRoutingRule , sourceHub :: !Hub , targetHub :: !Hub } instance View ShowView where html ShowView { .. } = [hsx|
Routing Rules /

Routing Rule

{sourceHub.name} → {targetHub.name} " text-xs px-2 py-0.5 rounded font-medium"}> {rule.status}
Match Category
{fromMaybe "any" rule.matchCategory}
Match Widget Type
{fromMaybe "any" rule.matchWidgetType}
Priority
{show rule.priority}
Created
{show rule.createdAt}
{maybe mempty renderRuleNotesDt rule.notes}
Edit {renderRuleToggleAction rule.id (rule.status == "inactive")} Routed Candidates →
|] renderRuleNotesDt :: Text -> Html renderRuleNotesDt n = [hsx|
Notes
{n}
|] renderRuleToggleAction :: Id HubRoutingRule -> Bool -> Html renderRuleToggleAction rid True = [hsx|Activate|] renderRuleToggleAction rid False = [hsx|Deactivate|]