chore: [app-router-migration 22] Migrate `/insights` page (#13055)

* intuita codemod: remove-get-static-props

* intuita codemod: app-directory-boilerplate-calcom

* manual: refactor and add metadata title/description

* manual: Change structure & Refactor to make code up to date
This commit is contained in:
Benny Joo 2024-01-11 12:45:26 +00:00 committed by GitHub
parent 0df6777814
commit 6f110d21fd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 28 additions and 0 deletions

View File

@ -0,0 +1,26 @@
import LegacyPage from "@pages/insights/index";
import { _generateMetadata } from "app/_utils";
import { WithLayout } from "app/layoutHOC";
import { notFound } from "next/navigation";
import { getLayout } from "@calcom/features/MainLayoutAppDir";
import { getFeatureFlagMap } from "@calcom/features/flags/server/utils";
export const generateMetadata = async () =>
await _generateMetadata(
() => "Insights",
(t) => t("insights_subtitle")
);
async function getData() {
const prisma = await import("@calcom/prisma").then((mod) => mod.default);
const flags = await getFeatureFlagMap(prisma);
if (flags.insights === false) {
return notFound();
}
return {};
}
export default WithLayout({ getLayout, getData, Page: LegacyPage });

View File

@ -1,3 +1,5 @@
"use client";
import { getLayout } from "@calcom/features/MainLayout";
import { getFeatureFlagMap } from "@calcom/features/flags/server/utils";
import {