diff options
Diffstat (limited to 'app/layout.tsx')
| -rw-r--r-- | app/layout.tsx | 85 |
1 files changed, 85 insertions, 0 deletions
diff --git a/app/layout.tsx b/app/layout.tsx new file mode 100644 index 00000000..7ed768a5 --- /dev/null +++ b/app/layout.tsx @@ -0,0 +1,85 @@ +import type { Metadata } from "next"; +import { Inter } from "next/font/google"; +import "./globals.css"; +import { languages } from "@/i18n/settings"; +import { Toaster } from "@/components/ui/toaster" +import { ThemeProvider } from "@/components/layout/providers"; +import { cn } from "@/lib/utils" +import { META_THEME_COLORS, siteConfig } from "@/config/site" +import { LicenseInfo } from '@mui/x-license'; +import { ToasterSonner } from "@/components/ui/toasterSonner"; + +LicenseInfo.setLicenseKey(process.env.NEXT_PUBLIC_MUI_KEY as string); + +const inter = Inter({ subsets: ['latin'] }); + +export const generateStaticParams = async () => { + return languages.map((lng) => ({ lng })); +}; + +export const metadata: Metadata = { + title: { + default: siteConfig.name, + template: `%s - ${siteConfig.name}`, + }, + metadataBase: new URL(siteConfig.url), + description: siteConfig.description, + authors: [ + { + name: "DTS", + url: "https://dtsoution.io", + }, + ], + creator: "dujin", +}; + +export default async function RootLayout({ + children, + params: { lng }, +}: { + children: React.ReactNode; + params: { lng: string }; +}) { + + + return ( + <html lang={lng} suppressHydrationWarning> + <head> + <script + dangerouslySetInnerHTML={{ + __html: ` + try { + if (localStorage.theme === 'dark' || ((!('theme' in localStorage) || localStorage.theme === 'system') && window.matchMedia('(prefers-color-scheme: dark)').matches)) { + document.querySelector('meta[name="theme-color"]').setAttribute('content', '${META_THEME_COLORS.dark}') + } + } catch (_) {} + `, + }} + /> + </head> + + <body + className={cn( + "min-h-svh bg-background font-sans antialiased", + inter.className, + )} + > + <ThemeProvider + attribute="class" + defaultTheme="system" + enableSystem + disableTransitionOnChange + enableColorScheme + > + <div vaul-drawer-wrapper=""> + <div className="relative flex min-h-svh flex-col bg-background"> + {children} + </div> + </div> + <Toaster /> + <ToasterSonner/> + </ThemeProvider> + </body> + </html> + ); +}
\ No newline at end of file |
