* add v2 for app setup pages * create v2 app setup page * Build fixes Co-authored-by: CarinaWolli <wollencarina@gmail.com> Co-authored-by: zomars <zomars@me.com>
21 lines
578 B
TypeScript
21 lines
578 B
TypeScript
import { GetStaticPropsContext } from "next";
|
|
|
|
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;
|
|
};
|