2026-03-17 15:35:58 +01:00
|
|
|
import { A, useParams } from '@solidjs/router';
|
2026-04-02 13:36:16 +02:00
|
|
|
import { Show, For, createSignal, createResource, onCleanup, onMount } from 'solid-js';
|
|
|
|
|
import { fetchArticleBySlug } from '~/lib/help-center';
|
2026-03-19 02:35:19 +01:00
|
|
|
import PublicBackground from '~/components/PublicBackground';
|
2026-03-17 15:35:58 +01:00
|
|
|
import PublicHeader from '~/components/PublicHeader';
|
2026-03-19 02:35:19 +01:00
|
|
|
import PublicFooter from '~/components/PublicFooter';
|
2026-03-17 15:35:58 +01:00
|
|
|
|
|
|
|
|
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();
|
2026-03-19 02:35:19 +01:00
|
|
|
const [scrollY, setScrollY] = createSignal(0);
|
|
|
|
|
|
2026-04-02 13:36:16 +02:00
|
|
|
const [article] = createResource(() => params.slug, fetchArticleBySlug);
|
|
|
|
|
|
2026-03-19 02:35:19 +01:00
|
|
|
onMount(() => {
|
|
|
|
|
const onScroll = () => setScrollY(window.scrollY || 0);
|
|
|
|
|
onScroll();
|
|
|
|
|
window.addEventListener('scroll', onScroll, { passive: true });
|
|
|
|
|
onCleanup(() => window.removeEventListener('scroll', onScroll));
|
|
|
|
|
});
|
2026-03-17 15:35:58 +01:00
|
|
|
|
2026-04-02 13:36:16 +02:00
|
|
|
return (
|
|
|
|
|
<main class="lp-main">
|
|
|
|
|
<PublicBackground scrollY={scrollY()} />
|
|
|
|
|
<div class="lp-content">
|
|
|
|
|
<PublicHeader />
|
|
|
|
|
|
|
|
|
|
<Show when={article.loading}>
|
|
|
|
|
<section class="public-section scene-dark">
|
|
|
|
|
<div class="container panel panel-light" style={{ 'max-width': '960px' }}>
|
|
|
|
|
<p style="color:#94a3b8;padding:40px 0;text-align:center">Loading article…</p>
|
|
|
|
|
</div>
|
|
|
|
|
</section>
|
|
|
|
|
</Show>
|
|
|
|
|
|
|
|
|
|
<Show when={!article.loading && !article()}>
|
2026-03-19 02:35:19 +01:00
|
|
|
<section class="public-section scene-dark">
|
2026-03-17 15:35:58 +01:00
|
|
|
<div class="container panel panel-light">
|
|
|
|
|
<h1 class="title">Article not found</h1>
|
|
|
|
|
<p class="subtitle">The requested Help Center article is unavailable.</p>
|
|
|
|
|
<div class="actions">
|
|
|
|
|
<A class="btn primary" href="/help-center">Back to Help Center</A>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</section>
|
2026-04-02 13:36:16 +02:00
|
|
|
</Show>
|
2026-03-17 15:35:58 +01:00
|
|
|
|
2026-04-02 13:36:16 +02:00
|
|
|
<Show when={!article.loading && article()}>
|
|
|
|
|
{(a) => (
|
|
|
|
|
<>
|
|
|
|
|
<section class="public-section scene-dark">
|
|
|
|
|
<div class="container panel panel-light" style={{ 'max-width': '960px' }}>
|
|
|
|
|
<p class="eyebrow">{a().category || categoryTitle(a().categoryKey)}</p>
|
|
|
|
|
<h1 class="title">{a().title}</h1>
|
|
|
|
|
<p class="subtitle">{a().summary}</p>
|
2026-03-17 15:35:58 +01:00
|
|
|
|
2026-04-02 13:36:16 +02:00
|
|
|
<Show when={a().tags.length > 0}>
|
|
|
|
|
<div class="help-article-tags" style={{ 'margin-top': '10px' }}>
|
|
|
|
|
<For each={a().tags}>{(tag) => <span class="help-article-tag">{tag}</span>}</For>
|
|
|
|
|
</div>
|
|
|
|
|
</Show>
|
2026-03-17 15:35:58 +01:00
|
|
|
|
2026-04-02 13:36:16 +02:00
|
|
|
<p class="note">Updated {new Date(a().updatedAt).toLocaleDateString()}</p>
|
2026-03-17 15:35:58 +01:00
|
|
|
|
2026-04-02 13:36:16 +02:00
|
|
|
<div class="help-article-body">
|
|
|
|
|
<For each={a().content.split('\n\n').filter(Boolean)}>
|
|
|
|
|
{(para) => <p>{para}</p>}
|
|
|
|
|
</For>
|
|
|
|
|
</div>
|
2026-03-17 15:35:58 +01:00
|
|
|
|
2026-04-02 13:36:16 +02:00
|
|
|
<div class="actions">
|
|
|
|
|
<A class="btn" href="/help-center">Back to Help Center</A>
|
|
|
|
|
<A class="btn primary" href="/auth/register">Get Started</A>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</section>
|
|
|
|
|
|
|
|
|
|
<section class="public-section scene-dark">
|
|
|
|
|
<div class="container panel panel-light" style={{ 'max-width': '960px' }}>
|
|
|
|
|
<h2>Need more help?</h2>
|
|
|
|
|
<p class="sub">
|
|
|
|
|
If this article does not solve your issue, send your question with context to support.
|
|
|
|
|
</p>
|
|
|
|
|
<div class="actions">
|
|
|
|
|
<a class="btn primary" href="mailto:support@nxtgauge.com?subject=Nxtgauge%20Help%20Center%20Question">
|
|
|
|
|
Email support
|
|
|
|
|
</a>
|
|
|
|
|
<A class="btn" href="/help-center">Browse more articles</A>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</section>
|
|
|
|
|
</>
|
|
|
|
|
)}
|
|
|
|
|
</Show>
|
2026-03-19 02:35:19 +01:00
|
|
|
|
|
|
|
|
<PublicFooter />
|
2026-03-17 15:35:58 +01:00
|
|
|
</div>
|
|
|
|
|
</main>
|
|
|
|
|
);
|
|
|
|
|
}
|