import type { Metadata } from 'next'
import { DashboardI18nProvider } from '@/components/I18nProvider'
import './globals.css'

export const metadata: Metadata = {
  title: 'RentalDriveGo Dashboard',
  description: 'Manage your rental car business',
}

export default function RootLayout({ children }: { children: React.ReactNode }) {
  return (
    <html lang="en" className="light" suppressHydrationWarning>
      <head>
        <script
          dangerouslySetInnerHTML={{
            __html:
              "(function(){try{var theme=localStorage.getItem('dashboard-theme');if(theme!=='light'&&theme!=='dark'){theme=window.matchMedia('(prefers-color-scheme: dark)').matches?'dark':'light'}document.documentElement.classList.remove('light','dark');document.documentElement.classList.add(theme);document.documentElement.style.colorScheme=theme}catch(e){}})();",
          }}
        />
      </head>
      <body className="font-sans">
        <DashboardI18nProvider>{children}</DashboardI18nProvider>
      </body>
    </html>
  )
}
