import fs from "fs"; import path from "path"; import Link from "next/link"; import { notFound } from "next/navigation"; function formatTitle(slug: string) { return slug.replace(/-/g, " ").replace(/\b\w/g, (c) => c.toUpperCase()); } export default async function ViewPage({ params, }: { params: Promise<{ slug: string }>; }) { if (process.env.ALLOW_RTF !== "true") notFound(); const { slug } = await params; const htmlPath = path.join(process.cwd(), "public/html", `${slug}.html`); if (!fs.existsSync(htmlPath)) { notFound(); } return (