diff --git a/examples/default-provider/app/layout.tsx b/examples/default-provider/app/layout.tsx index aee5bb1..98d1c14 100644 --- a/examples/default-provider/app/layout.tsx +++ b/examples/default-provider/app/layout.tsx @@ -1,19 +1,26 @@ -import type { Metadata } from "next"; -import Link from "next/link"; +import { dirname } from 'node:path'; +import { fileURLToPath } from 'node:url'; +import * as fs from 'node:fs/promises'; + +import type { Metadata } from 'next'; +import Link from 'next/link'; import { DM_Sans, JetBrains_Mono } from 'next/font/google'; -import { Providers } from './providers'; -import Nav from "./nav"; -import "./globals.css"; +import Nav from './nav'; +import './globals.css'; const dmSans = DM_Sans({ subsets: ['latin'], variable: '--sans' }); const jetBrainsMono = JetBrains_Mono({ subsets: ['latin'], variable: '--mono' }); export const metadata: Metadata = { - title: "next-video", - description: "Next Video solves the hard problems with embedding, storing, streaming, and customizing video in your Next.js app.", + title: 'next-video', + description: + 'Next Video solves the hard problems with embedding, storing, streaming, and customizing video in your Next.js app.', }; -export default function RootLayout({ +const fileDir = dirname(fileURLToPath(import.meta.url)); +const themeScript = await fs.readFile(`${fileDir}/theme-toggle.js`, 'utf-8'); + +export default async function RootLayout({ children, }: Readonly<{ children: React.ReactNode; @@ -25,29 +32,27 @@ export default function RootLayout({ className={`${dmSans.variable} ${jetBrainsMono.variable}`} > - -
- - next-video - playground - -
- - - {children} -
+