|
| 1 | +import "@/styles/globals.css" |
| 2 | +import { Metadata } from "next" |
| 3 | + |
| 4 | +import { siteConfig } from "@/config/site" |
| 5 | +import { fontSans } from "@/lib/fonts" |
| 6 | +import { cn } from "@/lib/utils" |
| 7 | +import { SiteHeader } from "@/components/site-header" |
| 8 | +import { TailwindIndicator } from "@/components/tailwind-indicator" |
| 9 | +import { ThemeProvider } from "@/components/theme-provider" |
| 10 | + |
| 11 | +export const metadata: Metadata = { |
| 12 | + title: { |
| 13 | + default: siteConfig.name, |
| 14 | + template: `%s - ${siteConfig.name}`, |
| 15 | + }, |
| 16 | + description: siteConfig.description, |
| 17 | + themeColor: [ |
| 18 | + { media: "(prefers-color-scheme: light)", color: "white" }, |
| 19 | + { media: "(prefers-color-scheme: dark)", color: "black" }, |
| 20 | + ], |
| 21 | + icons: { |
| 22 | + icon: "/favicon.ico", |
| 23 | + shortcut: "/favicon-16x16.png", |
| 24 | + apple: "/apple-touch-icon.png", |
| 25 | + }, |
| 26 | +} |
| 27 | + |
| 28 | +interface RootLayoutProps { |
| 29 | + children: React.ReactNode |
| 30 | +} |
| 31 | + |
| 32 | +export default function RootLayout({ children }: RootLayoutProps) { |
| 33 | + return ( |
| 34 | + <> |
| 35 | + <html lang="en" suppressHydrationWarning> |
| 36 | + <head /> |
| 37 | + <body |
| 38 | + className={cn( |
| 39 | + "min-h-screen bg-background font-sans antialiased", |
| 40 | + fontSans.variable |
| 41 | + )} |
| 42 | + > |
| 43 | + <ThemeProvider attribute="class" defaultTheme="system" enableSystem> |
| 44 | + <div className="relative flex min-h-screen flex-col"> |
| 45 | + <SiteHeader /> |
| 46 | + <div className="flex-1">{children}</div> |
| 47 | + </div> |
| 48 | + <TailwindIndicator /> |
| 49 | + </ThemeProvider> |
| 50 | + </body> |
| 51 | + </html> |
| 52 | + </> |
| 53 | + ) |
| 54 | +} |
0 commit comments