module Web.View.Hubs.Show where import Web.Types import Generated.Types import IHP.Prelude import IHP.ViewPrelude data ShowView = ShowView { hub :: !Hub , widgets :: ![Widget] , recentEvents :: ![InteractionEvent] , recentAnnotations :: ![Annotation] } instance View ShowView where html ShowView { .. } = [hsx|
Hubs / {hub.name}

{hub.name}

{hub.slug} {hub.domain}

Widgets

{length widgets}

Recent Events

{length recentEvents}

Recent Annotations

{length recentAnnotations}

Widgets

{forEach widgets renderWidgetRow}
Name Type Status Version

Recent Interaction Events

{forEach recentEvents renderEventRow}
Event Actor Occurred

Recent Annotations

{forEach recentAnnotations renderAnnotationCard}
|] renderWidgetRow :: Widget -> Html renderWidgetRow w = [hsx| {w.name} {w.widgetType} {w.status} v{show w.version} |] renderEventRow :: InteractionEvent -> Html renderEventRow e = [hsx| {e.eventType} {e.actorType} {show e.occurredAt} |] renderAnnotationCard :: Annotation -> Html renderAnnotationCard a = [hsx|
{a.category} {a.actorType}

{a.body}

|]