playgo_next / app /layout.tsx
ChenyuRabbitLove's picture
feat: add embeddedable chat component
c4412d0
import type { Metadata } from "next";
import localFont from "next/font/local";
import "./globals.css";
import { ThemeProvider } from "@/app/components/theme-provider";
import { TopNav } from "./components/top-nav";
import { headers } from 'next/headers';
const geistSans = localFont({
src: "./fonts/GeistVF.woff",
variable: "--font-geist-sans",
weight: "100 900",
});
export const metadata: Metadata = {
title: "PlayGo AI - AI-Powered Learning Platform",
description:
"Transform education with AI-powered interactive learning experiences",
};
export default async function RootLayout({
children,
}: {
children: React.ReactNode;
}) {
const headersList = await headers();
const pathname = headersList.get("x-pathname") || "";
const isEmbed = pathname.startsWith("/embed");
if (isEmbed) {
return children;
}
return (
<html
lang="en"
suppressHydrationWarning
className={`${geistSans.variable}`}
>
<body className="antialiased">
<ThemeProvider
attribute="class"
defaultTheme="system"
enableSystem
disableTransitionOnChange
>
<TopNav />
<main className="pt-14">
{children}
</main>
</ThemeProvider>
</body>
</html>
);
}