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:
parent
0df6777814
commit
6f110d21fd
|
@ -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 });
|
|
@ -1,3 +1,5 @@
|
||||||
|
"use client";
|
||||||
|
|
||||||
import { getLayout } from "@calcom/features/MainLayout";
|
import { getLayout } from "@calcom/features/MainLayout";
|
||||||
import { getFeatureFlagMap } from "@calcom/features/flags/server/utils";
|
import { getFeatureFlagMap } from "@calcom/features/flags/server/utils";
|
||||||
import {
|
import {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user