import { vipnagorgialla } from "@/components/Vipnagorgialla"; import path from "node:path"; import fs from "node:fs/promises"; import ReactMarkdown from "react-markdown"; type Props = { params: Promise<{ slug: string }>; }; export default async function RulePage({ params }: Props) { const { slug } = await params; const filePath = path.join(process.cwd(), "src/data/rules", `${slug}.md`); let file: string; try { file = await fs.readFile(filePath, "utf8"); } catch { file = `# ${slug.toUpperCase()} REEGLID\n\nSisu hetkel puudub.`; } const data = { title: undefined as string | undefined }; return ( <>

{data.title || `${slug.toUpperCase()} REEGLID`}

{file}
); }