2022-05-11 04:58:10 +00:00
|
|
|
import { GetStaticPropsContext } from "next";
|
|
|
|
|
|
|
|
export const AppSetupPageMap = {
|
|
|
|
zapier: import("../../zapier/pages/setup/_getStaticProps"),
|
2022-06-07 06:13:32 +00:00
|
|
|
"apple-calendar": {
|
|
|
|
getStaticProps: null,
|
|
|
|
},
|
2022-06-11 17:33:04 +00:00
|
|
|
"caldav-calendar": {
|
|
|
|
getStaticProps: null,
|
|
|
|
},
|
2022-05-11 04:58:10 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
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;
|
|
|
|
};
|