2023-02-16 22:39:57 +00:00
|
|
|
import type { GetStaticPropsContext } from "next";
|
2022-05-11 04:58:10 +00:00
|
|
|
|
|
|
|
import getAppKeysFromSlug from "../../../_utils/getAppKeysFromSlug";
|
|
|
|
|
|
|
|
export interface IZapierSetupProps {
|
|
|
|
inviteLink: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export const getStaticProps = async (ctx: GetStaticPropsContext) => {
|
|
|
|
if (typeof ctx.params?.slug !== "string") return { notFound: true } as const;
|
|
|
|
let inviteLink = "";
|
|
|
|
const appKeys = await getAppKeysFromSlug("zapier");
|
|
|
|
if (typeof appKeys.invite_link === "string") inviteLink = appKeys.invite_link;
|
|
|
|
|
|
|
|
return {
|
|
|
|
props: {
|
|
|
|
inviteLink,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
};
|