Files
zhimingge/app/learn/other/[guaMark]/page.tsx
T
dekun fff77dac3f Implement three divination modes, learn pages, and PM2 deploy on port 3130.
Add liuyao/bazi/combined flows with shared calc and AI infrastructure, 64-gua learn routes, and update Ubuntu PM2 deployment docs for port 3130.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-10 20:19:49 +08:00

48 lines
1.4 KiB
TypeScript

import Link from "next/link";
import { notFound } from "next/navigation";
import PageShell from "@/components/page-shell";
import GuaFooter from "@/components/learn/gua-footer";
import MarkdownContent from "@/components/learn/markdown-content";
import {
getGuaName,
getGuaNumber,
listGuaMarks,
readLearnMarkdown,
stripFrontmatter,
} from "@/lib/content/zhouyi";
export async function generateStaticParams() {
const marks = await listGuaMarks("simplified");
return marks.map((guaMark) => ({ guaMark }));
}
export default async function GuaOtherDetailPage({
params,
}: {
params: Promise<{ guaMark: string }>;
}) {
const { guaMark } = await params;
const marks = await listGuaMarks("simplified");
if (!marks.includes(guaMark)) {
notFound();
}
const raw = await readLearnMarkdown(guaMark, "simplified");
const content = stripFrontmatter(raw);
return (
<PageShell className="max-w-3xl px-4 py-8">
<div className="mb-6 text-sm text-muted-foreground">
<Link href="/learn/other" className="hover:text-foreground">
</Link>
</div>
<div className="mb-4 text-sm text-muted-foreground">
{getGuaNumber(guaMark)} · {getGuaName(guaMark)}
</div>
<MarkdownContent content={content} variant="simplified" />
<GuaFooter guaMark={guaMark} />
</PageShell>
);
}