import { getDocumentation } from "@/common/documentation"; import { CustomMDX } from "@/app/components/mx-components"; export async function generateStaticParams() { let documentationPages = getDocumentation(); return documentationPages.map(page => ({ slug: [page.slug], })); } type DocumentationPageParams = { params: { slug?: string; }; }; export default function Page({ params: { slug } }: DocumentationPageParams) { const documentationPages = getDocumentation(); let page = documentationPages.find(page => page.slug === slug); // Fallback to the landing page if (!page) { page = documentationPages.find(page => page.slug === "landing"); } // Fallback to a 404 page if we still can't find the page if (!page) { page = { metadata: { title: "404 - Not Found", }, content: "If you are seeing this, it means that the documentation page you are looking for does not exist.", slug: "empty", }; } return (