11import "../../global.css" ;
22import { DashboardRouterTopProgressBar } from "@/lib/DashboardRouter" ;
33import { cn } from "@/lib/utils" ;
4- import { PHProvider } from "lib/posthog/Posthog" ;
5- import { PosthogHeadSetup } from "lib/posthog/PosthogHeadSetup" ;
6- import { PostHogPageView } from "lib/posthog/PosthogPageView" ;
4+
5+ import { DashboardAnalyticsInitializer } from "@/analytics/dasboard.client" ;
76import type { Metadata } from "next" ;
87import PlausibleProvider from "next-plausible" ;
98import { Inter } from "next/font/google" ;
109import NextTopLoader from "nextjs-toploader" ;
10+ import { getRawAccount } from "./account/settings/getAccount" ;
1111import { AppRouterProviders } from "./providers" ;
1212
1313const fontSans = Inter ( {
@@ -48,11 +48,12 @@ export const metadata: Metadata = {
4848 } ,
4949} ;
5050
51- export default function RootLayout ( {
51+ export default async function RootLayout ( {
5252 children,
5353} : {
5454 children : React . ReactNode ;
5555} ) {
56+ const account = await getRawAccount ( ) ;
5657 return (
5758 < html lang = "en" suppressHydrationWarning >
5859 < head >
@@ -61,26 +62,20 @@ export default function RootLayout({
6162 customDomain = "https://pl.thirdweb.com"
6263 selfHosted
6364 />
64- < PosthogHeadSetup />
6565 </ head >
66- < PHProvider disable_session_recording = { true } >
67- < PostHogPageView />
68- < body
69- className = { cn (
70- "bg-background font-sans antialiased" ,
71- fontSans . variable ,
72- ) }
73- >
74- < AppRouterProviders > { children } </ AppRouterProviders >
75- < DashboardRouterTopProgressBar />
76- < NextTopLoader
77- color = "hsl(var(--foreground))"
78- height = { 3 }
79- shadow = { false }
80- showSpinner = { false }
81- />
82- </ body >
83- </ PHProvider >
66+ < body
67+ className = { cn ( "bg-background font-sans antialiased" , fontSans . variable ) }
68+ >
69+ < AppRouterProviders > { children } </ AppRouterProviders >
70+ < DashboardRouterTopProgressBar />
71+ < DashboardAnalyticsInitializer accountId = { account ?. id } />
72+ < NextTopLoader
73+ color = "hsl(var(--foreground))"
74+ height = { 3 }
75+ shadow = { false }
76+ showSpinner = { false }
77+ />
78+ </ body >
8479 </ html >
8580 ) ;
8681}
0 commit comments