Skip to content

Commit 4074d1b

Browse files
committed
refactor insights/layout.tsx
1 parent 3c6041a commit 4074d1b

File tree

1 file changed

+6
-56
lines changed
  • apps/web/app/(use-page-wrapper)/insights

1 file changed

+6
-56
lines changed

apps/web/app/(use-page-wrapper)/insights/layout.tsx

Lines changed: 6 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,15 @@
1-
"use client";
2-
3-
import { useSession } from "next-auth/react";
1+
import { getTranslate } from "app/_utils";
42

53
import Shell from "@calcom/features/shell/Shell";
6-
import { UpgradeTip } from "@calcom/features/tips";
7-
import { WEBAPP_URL } from "@calcom/lib/constants";
8-
import { useLocale } from "@calcom/lib/hooks/useLocale";
9-
import { Button, ButtonGroup } from "@calcom/ui";
10-
import { Icon } from "@calcom/ui";
11-
12-
export default function InsightsLayout({ children }: { children: React.ReactNode }) {
13-
const { t } = useLocale();
14-
const session = useSession();
154

16-
const features = [
17-
{
18-
icon: <Icon name="users" className="h-5 w-5" />,
19-
title: t("view_bookings_across"),
20-
description: t("view_bookings_across_description"),
21-
},
22-
{
23-
icon: <Icon name="refresh-ccw" className="h-5 w-5" />,
24-
title: t("identify_booking_trends"),
25-
description: t("identify_booking_trends_description"),
26-
},
27-
{
28-
icon: <Icon name="user-plus" className="h-5 w-5" />,
29-
title: t("spot_popular_event_types"),
30-
description: t("spot_popular_event_types_description"),
31-
},
32-
];
5+
import UpgradeTipWrapper from "./UpgradeTipWrapper";
336

7+
export default async function InsightsLayout({ children }: { children: React.ReactNode }) {
8+
const t = await getTranslate();
349
return (
3510
<div>
36-
<Shell
37-
withoutMain={false}
38-
withoutSeo={true}
39-
heading={t("insights")}
40-
subtitle={t("insights_subtitle")}
41-
title={t("insights")}
42-
description={t("insights_subtitle")}>
43-
<UpgradeTip
44-
plan="team"
45-
title={t("make_informed_decisions")}
46-
description={t("make_informed_decisions_description")}
47-
features={features}
48-
background="/tips/insights"
49-
buttons={
50-
<div className="space-y-2 rtl:space-x-reverse sm:space-x-2">
51-
<ButtonGroup>
52-
<Button color="primary" href={`${WEBAPP_URL}/settings/teams/new`}>
53-
{t("create_team")}
54-
</Button>
55-
<Button color="minimal" href="https://go.cal.com/insights" target="_blank">
56-
{t("learn_more")}
57-
</Button>
58-
</ButtonGroup>
59-
</div>
60-
}>
61-
{!session.data?.user ? null : children}
62-
</UpgradeTip>
11+
<Shell withoutMain={false} withoutSeo={true} heading={t("insights")} subtitle={t("insights_subtitle")}>
12+
<UpgradeTipWrapper>{children}</UpgradeTipWrapper>
6313
</Shell>
6414
</div>
6515
);

0 commit comments

Comments
 (0)