import { A, useParams } from "@solidjs/router"; import { Meta, Title } from "@solidjs/meta"; import { Show, For, createSignal, createResource, onCleanup, onMount, createMemo } from "solid-js"; import { fetchArticleBySlug, fetchRelatedArticles } from "~/lib/help-center"; import PublicBackground from "~/components/PublicBackground"; import PublicHeader from "~/components/PublicHeader"; import PublicFooter from "~/components/PublicFooter"; import ArticleContent from "~/components/ArticleContent"; 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 slug = createMemo(() => String(params.slug || "").trim()); const [scrollY, setScrollY] = createSignal(0); const [article] = createResource(() => params.slug, fetchArticleBySlug); const [relatedArticles] = createResource( () => article(), (item) => (item ? fetchRelatedArticles({ article: item, limit: 4 }) : []) ); const canonical = createMemo( () => `https://test121.nxtgauge.com/help-center/article/${encodeURIComponent(slug())}` ); const pageTitle = createMemo(() => { const a = article(); return a ? `${a.title} | Nxtgauge Help Center` : "Help Center Article | Nxtgauge"; }); const pageDescription = createMemo(() => { const a = article(); return a?.summary || "Read support and product guidance from Nxtgauge Help Center."; }); onMount(() => { const onScroll = () => setScrollY(window.scrollY || 0); onScroll(); window.addEventListener("scroll", onScroll, { passive: true }); onCleanup(() => window.removeEventListener("scroll", onScroll)); }); const formattedDate = createMemo(() => { const a = article(); if (!a?.updatedAt) return ""; const date = new Date(a.updatedAt); return date.toLocaleDateString("en-US", { month: "short", day: "numeric", year: "numeric" }); }); return (
{pageTitle()}
{/* Breadcrumb - Dark */}
{/* Loading State */}

Loading article...

{/* Not Found State */}

Article not found

The requested Help Center article is unavailable or has been moved.

Back to Help Center
{/* Article Content */} {(a) => ( <> {/* Dark Article Header */}
{a().category || categoryTitle(a().categoryKey)}

{a().title}

{a().summary}

0}>
{(tag) => ( {tag} )}
Updated {formattedDate()}
{/* Light Content Section */}
No content available.

} >
{/* Related Articles - Light */} 0}>
{/* Help Section - Dark */}

Need more help?

If this article does not solve your issue, send your question with context to support.

)}
); }