1- import { openapi , source } from "@/app/source" ;
1+ import { source } from "@/app/source" ;
22import type { Metadata } from "next" ;
33import {
44 DocsPage ,
@@ -7,14 +7,14 @@ import {
77 DocsTitle ,
88} from "fumadocs-ui/page" ;
99import { notFound } from "next/navigation" ;
10- import defaultMdxComponents from "fumadocs-ui /mdx" ;
10+ import { getMDXComponents } from "@ /mdx-components " ;
1111
1212export default async function Page ( {
1313 params,
1414} : {
15- params : { slug ?: string [ ] } ;
15+ params : Promise < { slug ?: string [ ] } > ;
1616} ) {
17- const page = source . getPage ( params . slug ) ;
17+ const page = source . getPage ( ( await params ) . slug ) ;
1818 if ( ! page ) notFound ( ) ;
1919
2020 const MDX = page . data . body ;
@@ -24,9 +24,7 @@ export default async function Page({
2424 < DocsTitle > { page . data . title } </ DocsTitle >
2525 < DocsDescription > { page . data . description } </ DocsDescription >
2626 < DocsBody >
27- < MDX
28- components = { { ...defaultMdxComponents , APIPage : openapi . APIPage } }
29- />
27+ < MDX components = { getMDXComponents ( ) } />
3028 </ DocsBody >
3129 </ DocsPage >
3230 ) ;
@@ -36,8 +34,10 @@ export async function generateStaticParams() {
3634 return source . generateParams ( ) ;
3735}
3836
39- export function generateMetadata ( { params } : { params : { slug ?: string [ ] } } ) {
40- const page = source . getPage ( params . slug ) ;
37+ export async function generateMetadata ( {
38+ params,
39+ } : { params : Promise < { slug ?: string [ ] } > } ) {
40+ const page = source . getPage ( ( await params ) . slug ) ;
4141 if ( ! page ) notFound ( ) ;
4242
4343 return {
0 commit comments