chore: migrate /apps/installed pages (#18869)

This commit is contained in:
Benny Joo authored and GitHub committed 2025-01-24 10:41:24 -05:00
1 parent beb542e7cb
commit a069af715e
13 files changed
+41 -143

No files matched your search

@@ -0,0 +1,31 @@
import type { PageProps } from "app/_types";
import { _generateMetadata } from "app/_utils";
import { redirect } from "next/navigation";
import { z } from "zod";
import { AppCategories } from "@calcom/prisma/enums";
import InstalledApps from "~/apps/installed/[category]/installed-category-view";
const querySchema = z.object({
category: z.nativeEnum(AppCategories),
});
export const generateMetadata = async () => {
return await _generateMetadata(
(t) => t("installed_apps"),
(t) => t("manage_your_connected_apps")
);
};
const InstalledAppsWrapper = async ({ params }: PageProps) => {
const parsedParams = querySchema.safeParse(params);
if (!parsedParams.success) {
redirect("/apps/installed/calendar");
}
return <InstalledApps category={parsedParams.data.category} />;
};
export default InstalledAppsWrapper;
@@ -1,18 +0,0 @@
import { withAppDirSsr } from "app/WithAppDirSsr";
import { _generateMetadata } from "app/_utils";
import { WithLayout } from "app/layoutHOC";
import { getServerSidePropsAppDir } from "@lib/apps/installed/[category]/getServerSideProps";
import Page from "~/apps/installed/[category]/installed-category-view";
export const generateMetadata = async () => {
return await _generateMetadata(
(t) => t("installed_apps"),
(t) => t("manage_your_connected_apps")
);
};
const getData = withAppDirSsr(getServerSidePropsAppDir);
export default WithLayout({ getLayout: null, getData, Page });