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