fix: update glossary UI

This commit is contained in:
gosangam
2026-05-06 15:39:22 +05:30
parent 0498e3c0ac
commit e5fb370997
3 changed files with 533 additions and 294 deletions
+4 -48
View File
@@ -1,8 +1,5 @@
import type { Metadata } from "next";
import Link from "next/link";
import { PageHeader } from "@/components/page-header";
import { GlossaryClient } from "./glossary-client";
import { getAllGlossaryEntries } from "@/lib/api";
import { redirect } from "next/navigation";
import { buildOgMeta } from "@/lib/og";
export function generateMetadata(): Metadata {
@@ -14,48 +11,7 @@ export function generateMetadata(): Metadata {
});
}
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"
>
&larr; 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-5xl mx-auto px-6 py-8">
<GlossaryClient data={data} />
</main>
</div>
);
// Redirect /glossary to /glossary/a
export default function GlossaryPage() {
redirect("/glossary/a");
}