Skip to content

Commit 447ec02

Browse files
committed
feat: webhook analytics tab
1 parent 26c080f commit 447ec02

File tree

1 file changed

+55
-50
lines changed
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/webhooks

1 file changed

+55
-50
lines changed

apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/webhooks/layout.tsx

Lines changed: 55 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -2,57 +2,62 @@ import posthog from "posthog-js";
22
import { TabPathLinks } from "@/components/ui/tabs";
33

44
export default async function WebhooksLayout(props: {
5-
children: React.ReactNode;
6-
params: Promise<{
7-
team_slug: string;
8-
project_slug: string;
9-
}>;
5+
children: React.ReactNode;
6+
params: Promise<{
7+
team_slug: string;
8+
project_slug: string;
9+
}>;
1010
}) {
11-
// Enabled on dev or if FF is enabled.
12-
const isFeatureEnabled =
13-
!posthog.__loaded || posthog.isFeatureEnabled("centralized-webhooks");
11+
// Enabled on dev or if FF is enabled.
12+
const isFeatureEnabled =
13+
!posthog.__loaded || posthog.isFeatureEnabled("centralized-webhooks");
1414

15-
const params = await props.params;
16-
return (
17-
<div className="flex grow flex-col">
18-
<div className="pt-10 pb-4">
19-
<div className="container max-w-7xl">
20-
<h1 className="mb-1 font-semibold text-3xl tracking-tight">
21-
Webhooks
22-
</h1>
23-
<p className="text-base text-muted-foreground">
24-
Create and manage webhooks to get notified about events
25-
</p>
26-
</div>
27-
</div>
15+
const params = await props.params;
16+
return (
17+
<div className="flex grow flex-col">
18+
<div className="pt-10 pb-4">
19+
<div className="container max-w-7xl">
20+
<h1 className="mb-1 font-semibold text-3xl tracking-tight">
21+
Webhooks
22+
</h1>
23+
<p className="text-base text-muted-foreground">
24+
Create and manage webhooks to get notified about events
25+
</p>
26+
</div>
27+
</div>
2828

29-
<TabPathLinks
30-
links={[
31-
...(isFeatureEnabled
32-
? [
33-
{
34-
exactMatch: true,
35-
name: "Overview",
36-
path: `/team/${params.team_slug}/${params.project_slug}/webhooks`,
37-
},
38-
]
39-
: []),
40-
{
41-
name: "Contracts",
42-
path: `/team/${params.team_slug}/${params.project_slug}/webhooks/contracts`,
43-
},
44-
{
45-
name: "Universal Bridge",
46-
path: `/team/${params.team_slug}/${params.project_slug}/webhooks/universal-bridge`,
47-
},
48-
]}
49-
scrollableClassName="container max-w-7xl"
50-
/>
51-
<div className="h-6" />
52-
<div className="container flex max-w-7xl grow flex-col">
53-
{props.children}
54-
</div>
55-
<div className="h-10" />
56-
</div>
57-
);
29+
<TabPathLinks
30+
links={[
31+
...(isFeatureEnabled
32+
? [
33+
{
34+
exactMatch: true,
35+
name: "Overview",
36+
path: `/team/${params.team_slug}/${params.project_slug}/webhooks`,
37+
},
38+
{
39+
exactMatch: true,
40+
name: "Analytics",
41+
path: `/team/${params.team_slug}/${params.project_slug}/webhooks/analytics`,
42+
},
43+
]
44+
: []),
45+
{
46+
name: "Contracts",
47+
path: `/team/${params.team_slug}/${params.project_slug}/webhooks/contracts`,
48+
},
49+
{
50+
name: "Universal Bridge",
51+
path: `/team/${params.team_slug}/${params.project_slug}/webhooks/universal-bridge`,
52+
},
53+
]}
54+
scrollableClassName="container max-w-7xl"
55+
/>
56+
<div className="h-6" />
57+
<div className="container flex max-w-7xl grow flex-col">
58+
{props.children}
59+
</div>
60+
<div className="h-10" />
61+
</div>
62+
);
5863
}

0 commit comments

Comments
 (0)