dd26470754
- Register all 24 components in mdx-components.tsx via client boundary - MDX files can now render real components inline (not just code blocks) - media.mdx updated with live Figure and PullQuote demos
25 lines
687 B
TypeScript
25 lines
687 B
TypeScript
import { source } from '@/lib/source';
|
|
import { DocsPage, DocsBody } from 'fumadocs-ui/page';
|
|
import { notFound } from 'next/navigation';
|
|
import { useMDXComponents } from '../../../mdx-components';
|
|
|
|
export default async function Page(props: { params: Promise<{ slug?: string[] }> }) {
|
|
const params = await props.params;
|
|
const page = source.getPage(params.slug);
|
|
if (!page) notFound();
|
|
|
|
const MDX = page.data.body;
|
|
const components = useMDXComponents({});
|
|
return (
|
|
<DocsPage toc={page.data.toc}>
|
|
<DocsBody>
|
|
<MDX components={components} />
|
|
</DocsBody>
|
|
</DocsPage>
|
|
);
|
|
}
|
|
|
|
export function generateStaticParams() {
|
|
return source.generateParams();
|
|
}
|