diff --git a/src/components/ArticleContent.tsx b/src/components/ArticleContent.tsx new file mode 100644 index 0000000..4541d69 --- /dev/null +++ b/src/components/ArticleContent.tsx @@ -0,0 +1,137 @@ +import { For, Show } from "solid-js"; +import type { ContentBlock } from "~/data/help-center-seed"; + +interface ArticleContentProps { + blocks: ContentBlock[]; +} + +export default function ArticleContent(props: ArticleContentProps) { + const renderBlock = (block: ContentBlock) => { + switch (block.type) { + case "paragraph": + return ( +
+ {block.text} +
+ ); + + case "heading": + if (block.level === 2) { + return ( +Help Center
-Find guides and articles for your role.
++ Help Center +
++ Find guides and articles for your role. +
Loading help center...
++ Loading help center... +
Categories
-+ Categories +
+{cat.name}
-{cat.description || 'Knowledge base category'}
++ {cat.name} +
++ {cat.description || "Knowledge base category"} +
Articles
++ Articles +
No articles found.
+No articles found.
{a.title}
-{a.summary || 'Open article'}
+ ++ {a.title} +
++ {a.summary || "Open article"} +
)}Loading article…
-The requested Help Center article is unavailable.
-Loading article...
+ The requested Help Center article is unavailable or has been moved. +
+ + Back to Help Center + +{a().category || categoryTitle(a().categoryKey)}
-{a().summary}
- -