mirror of
https://github.com/hanzoai/calendar.git
synced 2026-09-24 22:42:24 +00:00
Co-authored-by: [email protected] <[email protected]> Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
29 lines
858 B
TypeScript
29 lines
858 B
TypeScript
import { generateStaticParamsFor, importPage } from "nextra/pages";
|
|
import { useMDXComponents as getMDXComponents } from "../../mdx-components";
|
|
|
|
export const generateStaticParams = generateStaticParamsFor("mdxPath");
|
|
|
|
export async function generateMetadata(props: {
|
|
params: Promise<{ mdxPath?: string[] }>;
|
|
}) {
|
|
const params = await props.params;
|
|
const { metadata } = await importPage(params.mdxPath);
|
|
return metadata;
|
|
}
|
|
|
|
const Wrapper = getMDXComponents().wrapper;
|
|
|
|
export default async function Page(props: {
|
|
params: Promise<{ mdxPath?: string[] }>;
|
|
}) {
|
|
const params = await props.params;
|
|
const { default: MDXContent, toc, metadata, sourceCode } = await importPage(
|
|
params.mdxPath,
|
|
);
|
|
return (
|
|
<Wrapper toc={toc} metadata={metadata} sourceCode={sourceCode}>
|
|
<MDXContent {...props} params={params} />
|
|
</Wrapper>
|
|
);
|
|
}
|