diff --git a/src/app/[locale]/layout.tsx b/src/app/[locale]/layout.tsx index f0fc880..b2d14bc 100644 --- a/src/app/[locale]/layout.tsx +++ b/src/app/[locale]/layout.tsx @@ -2,6 +2,7 @@ import { notFound } from 'next/navigation'; import { NextIntlClientProvider } from 'next-intl'; import { getMessages, setRequestLocale } from 'next-intl/server'; import { Inter } from 'next/font/google'; +import dynamic from 'next/dynamic'; import { locales, localeMetadata, seoKeywords, type Locale } from '@/i18n/config'; import type { Metadata } from 'next'; import { Header, Footer, GlobalBackground } from '@/components/layout'; @@ -9,6 +10,11 @@ import { PersonJsonLd, ProfessionalServiceJsonLd, OrganizationJsonLd, WebSiteJso import { WebVitals } from '@/components/analytics'; import '../globals.css'; +// Lazy load Chatbot component - uses browser-only APIs (localStorage) +const Chatbot = dynamic(() => import('@/components/chat/Chatbot').then((mod) => mod.Chatbot), { + ssr: false, +}); + const inter = Inter({ subsets: ['latin'], display: 'swap', @@ -123,6 +129,8 @@ export default async function LocaleLayout({ children, params }: Props) {
{children}