mongo fix
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
import Link from "next/link";
|
||||
import { PageHeader } from "@/components/page-header";
|
||||
import { GlossaryClient } from "./glossary-client";
|
||||
import { getAllGlossaryEntries } from "@/lib/api";
|
||||
|
||||
export default async function GlossaryPage() {
|
||||
const entries = await getAllGlossaryEntries();
|
||||
|
||||
const letters = Array.from(
|
||||
new Set(
|
||||
entries
|
||||
.map((e) => e.term.charAt(0).toUpperCase())
|
||||
.filter((ch) => ch.length > 0),
|
||||
),
|
||||
).sort();
|
||||
|
||||
const data = {
|
||||
title: "Glossary",
|
||||
description:
|
||||
"Sanskrit and Bengali terms used in the books of His Divine Grace A.C. Bhaktivedanta Swami Prabhupāda.",
|
||||
totalEntries: entries.length,
|
||||
letters,
|
||||
entries: entries.map((e) => ({
|
||||
term: e.term,
|
||||
definition: e.definition,
|
||||
definition_html: e.definitionHtml,
|
||||
})),
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="min-h-screen bg-background">
|
||||
<PageHeader>
|
||||
<Link
|
||||
href="/"
|
||||
className="text-sm text-muted-foreground hover:text-foreground transition-colors"
|
||||
>
|
||||
← Home
|
||||
</Link>
|
||||
<h1 className="mt-3 text-3xl font-bold text-foreground">
|
||||
{data.title}
|
||||
</h1>
|
||||
<p className="mt-1 text-muted-foreground">{data.description}</p>
|
||||
</PageHeader>
|
||||
|
||||
<main className="max-w-3xl mx-auto px-6 py-8">
|
||||
<GlossaryClient data={data} />
|
||||
</main>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user