import { A, useParams } from '@solidjs/router'; import { createSignal, onCleanup, onMount } from 'solid-js'; import { getArticleBySlug } from '~/lib/help-center'; import PublicBackground from '~/components/PublicBackground'; import PublicHeader from '~/components/PublicHeader'; import PublicFooter from '~/components/PublicFooter'; function categoryTitle(input: string) { return input .split('-') .filter(Boolean) .map((chunk) => chunk[0].toUpperCase() + chunk.slice(1)) .join(' '); } export default function HelpCenterArticlePage() { const params = useParams(); const article = getArticleBySlug(params.slug || ''); const [scrollY, setScrollY] = createSignal(0); onMount(() => { const onScroll = () => setScrollY(window.scrollY || 0); onScroll(); window.addEventListener('scroll', onScroll, { passive: true }); onCleanup(() => window.removeEventListener('scroll', onScroll)); }); if (!article) { return ( Article not found The requested Help Center article is unavailable. Back to Help Center ); } return ( {categoryTitle(article.categoryKey)} {article.title} {article.summary} {article.tags.map((tag) => {tag})} Updated {new Date(article.updatedAt).toLocaleDateString()} {article.content} Back to Help Center Get Started Need more help? If this article does not solve your issue, send your question with context to support. Email support Browse more articles ); }
The requested Help Center article is unavailable.
{categoryTitle(article.categoryKey)}
{article.summary}
Updated {new Date(article.updatedAt).toLocaleDateString()}
{article.content}
If this article does not solve your issue, send your question with context to support.