adds help pages, changes homepage fully over to ttcmd

This commit is contained in:
2024-03-10 04:56:44 -06:00
parent 7f63d38424
commit ed4497b991
12 changed files with 405 additions and 16 deletions

View File

@@ -0,0 +1,31 @@
"use client";
export default function Error({
error,
reset,
}: {
error: Error & { digest?: string };
reset: () => void;
}) {
return (
<div className="w-1/3 mx-auto mt-96">
<div className="card error">
<h1 className="text-4xl mb-8">Uh oh!</h1>
<p>
Seems like you found an article that doesn&apos;t exist. If you
clicked on a link from another help article, it&apos;s likely that
either the article has been renamed or hasn&apos;t been written yet.
</p>
<p>
You can let Emma know about the missing article in
[#help-articles](insert discord link here) on the official
CyborgGrizzly Discord server. Be sure to include the below error and
the page that you came from in case the link is broken.
</p>
<pre className="whitespace-pre-wrap rounded-md bg-black/20 p-4">
{`${error.name}\n${error.message}\n${error.digest}`}
</pre>
</div>
</div>
);
}

View File

@@ -0,0 +1,26 @@
import { TTCMD } from "@/components/ttcmd";
import { readFile } from "fs/promises";
import Error from "next/error";
import { Suspense } from "react";
export default async function Help({
params,
}: {
params: { article: string };
}) {
const body = readFile(
"./md/help articles/" + decodeURIComponent(params.article),
"utf-8",
);
return (
<>
<section className="heading">
<h2 className="strapline">Help</h2>
<h1>How to use TTCMD</h1>
</section>
<Suspense>
<TTCMD body={body} />
</Suspense>
</>
);
}