2023-02-16 22:39:57 +00:00
|
|
|
import type { GetStaticPropsContext } from "next";
|
2022-05-11 04:58:10 +00:00
|
|
|
|
|
|
|
export const AppSetupPageMap = {
|
|
|
|
zapier: import("../../zapier/pages/setup/_getStaticProps"),
|
|
|
|
};
|
|
|
|
|
|
|
|
export const getStaticProps = async (ctx: GetStaticPropsContext) => {
|
|
|
|
const { slug } = ctx.params || {};
|
|
|
|
if (typeof slug !== "string") return { notFound: true } as const;
|
|
|
|
|
|
|
|
if (!(slug in AppSetupPageMap)) return { props: {} };
|
|
|
|
|
|
|
|
const page = await AppSetupPageMap[slug as keyof typeof AppSetupPageMap];
|
|
|
|
|
|
|
|
if (!page.getStaticProps) return { props: {} };
|
|
|
|
|
|
|
|
const props = await page.getStaticProps(ctx);
|
|
|
|
|
|
|
|
return props;
|
|
|
|
};
|