1- import type { Metadata } from "next" ;
2- import { Geist } from "next/font/google" ;
1+ 'use client'
32import { ThemeProvider } from "next-themes" ;
43import { Toaster } from "sonner" ;
54import { ErrorBoundary } from "@/components/ErrorBoundary" ;
65import { GlobalErrorHandler } from "@/components/GlobalErrorHandler" ;
76import AIProvider from "@/components/ai/AIProvider" ;
8- import { getPageMetadata , getPageStructuredData } from "@/lib/seo/metadata" ;
7+ import { getPageStructuredData } from "@/lib/seo/metadata" ;
8+ import { usePathname } from "next/navigation" ;
99
1010// Only load dev tools in development
1111const ReactDevTools = ( ) => null ;
@@ -16,26 +16,13 @@ import "./globals.css";
1616// ? `https://${process.env.VERCEL_URL}`
1717// : "http://localhost:3000";
1818
19- export const metadata : Metadata = getPageMetadata ( 'home' , {
20- title : "Codeunia – Empowering Coders Globally" ,
21- description : "Join the global coding community. Participate in hackathons, compete on leaderboards, and advance your coding skills with Codeunia." ,
22- keywords : [ 'coding' , 'hackathons' , 'programming' , 'developer' , 'competition' , 'leaderboard' , 'coding community' ] ,
23- url : '/' ,
24- type : 'website'
25- } ) ;
26-
27- const geistSans = Geist ( {
28- variable : "--font-geist-sans" ,
29- display : "swap" ,
30- subsets : [ "latin" ] ,
31- } ) ;
32-
3319export default function RootLayout ( {
3420 children,
3521} : Readonly < {
3622 children : React . ReactNode ;
3723} > ) {
3824 const structuredData = getPageStructuredData ( 'home' ) ;
25+ const pathname = usePathname ( ) ;
3926
4027 return (
4128 < html lang = "en" suppressHydrationWarning >
@@ -84,7 +71,7 @@ export default function RootLayout({
8471 { /* Viewport for mobile optimization */ }
8572 < meta name = "viewport" content = "width=device-width, initial-scale=1, shrink-to-fit=no" />
8673 </ head >
87- < body className = { `${ geistSans . className } antialiased` } suppressHydrationWarning >
74+ < body className = { `antialiased` } suppressHydrationWarning >
8875 < ErrorBoundary >
8976 < ThemeProvider
9077 attribute = "class"
@@ -95,7 +82,7 @@ export default function RootLayout({
9582 < GlobalErrorHandler />
9683 { children }
9784 < Toaster richColors position = "top-center" />
98- < AIProvider />
85+ { ! pathname . startsWith ( '/dashboard/company' ) && < AIProvider /> }
9986
10087 < ReactDevTools />
10188 < AuthDebug />
0 commit comments