* Build HitPay app * Deleted a lint comment * Add redirect for iframe * Fix type check error * Fixed issue of payment pending * Update hitpay package.json * fix: fix lint issue in KeyInput and update zod * fix: fix issue of parsing string to number * fix: add default hitpay API links * fix: resolve atoms build error --------- Co-authored-by: kutsaniuk <kutsaniuk@gmail.com>
25 lines
867 B
TypeScript
25 lines
867 B
TypeScript
import type { GetServerSidePropsContext } from "next";
|
|
|
|
export const AppSetupPageMap = {
|
|
alby: import("../../alby/pages/setup/_getServerSideProps"),
|
|
make: import("../../make/pages/setup/_getServerSideProps"),
|
|
zapier: import("../../zapier/pages/setup/_getServerSideProps"),
|
|
stripe: import("../../stripepayment/pages/setup/_getServerSideProps"),
|
|
hitpay: import("../../hitpay/pages/setup/_getServerSideProps"),
|
|
};
|
|
|
|
export const getServerSideProps = async (ctx: GetServerSidePropsContext) => {
|
|
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.getServerSideProps) return { props: {} };
|
|
|
|
const props = await page.getServerSideProps(ctx);
|
|
|
|
return props;
|
|
};
|