mirror of
https://github.com/supabase/supabase.git
synced 2026-06-02 19:02:06 +08:00
27 lines
838 B
TypeScript
27 lines
838 B
TypeScript
import { GuideTemplate } from '~/features/docs/GuidesMdx.template'
|
|
import {
|
|
genGuideMeta,
|
|
genGuidesStaticParams,
|
|
getGuidesMarkdown,
|
|
} from '~/features/docs/GuidesMdx.utils'
|
|
import { getEmptyArray } from '~/features/helpers.fn'
|
|
import { IS_DEV } from '~/lib/constants'
|
|
|
|
type Params = { slug?: string[] }
|
|
|
|
const ApiGuidePage = async (props: { params: Promise<Params> }) => {
|
|
const params = await props.params
|
|
const slug = ['api', ...(params.slug ?? [])]
|
|
const data = await getGuidesMarkdown(slug)
|
|
|
|
return <GuideTemplate {...data!} />
|
|
}
|
|
|
|
const generateStaticParams = !IS_DEV ? genGuidesStaticParams('api') : getEmptyArray
|
|
const generateMetadata = genGuideMeta((params: { slug?: string[] }) =>
|
|
getGuidesMarkdown(['api', ...(params.slug ?? [])])
|
|
)
|
|
|
|
export default ApiGuidePage
|
|
export { generateStaticParams, generateMetadata }
|