|]
renderTrendingChip :: TrendingRow -> Html
renderTrendingChip (patternId, name, widgetType, count) = [hsx|
{name}{widgetType}{tshow count} adoptions
|]
jsonArrayTexts :: Value -> [Text]
jsonArrayTexts val = case decode (encode val) of
Just (arr :: [Text]) -> arr
Nothing -> []
renderTrendingSection :: [TrendingRow] -> Html
renderTrendingSection [] = mempty
renderTrendingSection rows = [hsx|
Trending (last 30 days)
{forEach rows renderTrendingChip}
|]
noPatternsMsg :: Html
noPatternsMsg = [hsx|
No patterns match your search.
|]
noTemplatesMsg :: Html
noTemplatesMsg = [hsx|
No templates match your search.
|]
renderPatternDesc :: Text -> Html
renderPatternDesc d = [hsx|
{d}
|]
renderCategoryChip :: Text -> Html
renderCategoryChip c = [hsx|{c}|]
renderWtOption :: Maybe Text -> (Text, Text) -> Html
renderWtOption mWType (n, l) = [hsx||]