help pages: adds a way to extract the table of contents to the parent, smoothes out the rough loading on help pages
26 lines
595 B
TypeScript
26 lines
595 B
TypeScript
import { readMD } from "@/actions/readMD";
|
|
import { HelpClient } from "./client";
|
|
import { Suspense } from "react";
|
|
import { Loader } from "@/components/loader";
|
|
|
|
// export const
|
|
|
|
export default async function Help({
|
|
params,
|
|
}: {
|
|
params: { article: string };
|
|
}) {
|
|
if (!params.article.endsWith(".md")) return;
|
|
const body = readMD(
|
|
"./md/help articles/" + decodeURIComponent(params.article),
|
|
);
|
|
return (
|
|
<Suspense fallback={<Loader />}>
|
|
<HelpClient
|
|
body={body}
|
|
title={decodeURIComponent(params.article).replace(".md", "")}
|
|
/>
|
|
</Suspense>
|
|
);
|
|
}
|