// app/kodukord/page.tsx (App Router) import ReactMarkdown, { Components } from "react-markdown"; import { vipnagorgialla } from "@/components/Vipnagorgialla"; import RuleNav from "@/components/RuleNav"; import { getTranslations, setRequestLocale } from "next-intl/server"; import { loadRulesBun } from "@/lib/loadRules"; const sectionKeys = [ { id: "reminder", labelKey: "rules.reminder" }, { id: "code", labelKey: "rules.code" }, ]; export default async function Page({ params, }: { params: Promise<{ locale: string }>; }) { const { locale } = await params; setRequestLocale(locale); const t = await getTranslations({ locale }); const content = await loadRulesBun("kodukord", locale as "et" | "en"); const sections = sectionKeys.map((section) => ({ id: section.id, label: t(section.labelKey), })); // Track heading count for ID assignment let headingCount = 0; return (
{props.children}
), li: (props) => (