import Link from "next/link"; import { getTranslations } from "next-intl/server"; import { HelpCircle } from "lucide-react"; import { StatusCard } from "@/components/admin/dashboard"; import { prisma } from "@/lib/prisma"; export const dynamic = "force-dynamic"; export default async function AdminHelpQuestions() { const t = await getTranslations("pages.admin.helpCenter"); let entries: Awaited> = []; try { entries = await prisma.websiteHelpCenterCategories.findMany({ orderBy: [{ position: "asc" }, { id: "asc" }], take: 500, }); } catch { entries = []; } const smallBoxes = entries.filter((e) => e.smallBox).length; const withButton = entries.filter((e) => e.buttonText).length; return (

{t("title")}

{t("subtitle")}

+ {t("newEntry")}

{t("entries")}

{entries.length === 0 ? (
{t("noEntries")}
) : ( {entries.map((e) => ( ))}
Pos. {t("colTitle")} Button Small box
{e.position} {e.name} {e.buttonText || "—"} {e.smallBox ? "Yes" : "No"} {t("edit")}
)}
); }