Emma d0cb74bea8 ttcmd: adds hr element
help pages: adds a way to extract the table of contents to the parent,
smoothes out the rough loading on help pages
2024-03-13 02:52:59 -06:00

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>
);
}