import type { Metadata } from "next";
import { JetBrains_Mono, DM_Sans } from "next/font/google";
import { SITE } from "@/data/content";
import "./globals.css";
import { ThemeProvider } from 'next-themes'
import ThemeSwitch from "@/components/ThemeSwitch";


const mono = JetBrains_Mono({
  subsets: ["latin"],
  variable: "--mono",
  display: "swap",
});

const sans = DM_Sans({
  subsets: ["latin"],
  variable: "--sans",
  display: "swap",
});

export const metadata: Metadata = {
  title: SITE.title,
  description: SITE.description
};

export default function RootLayout({
  children,
}: {
  children: React.ReactNode;
}) {
  return (
    <html lang="en" className={`${mono.variable} ${sans.variable}`} suppressHydrationWarning>
       <head />
      <body>   
          <noscript >
            <div style={{
              width: '100vw',
              height: '100vh',
              alignContent: 'center',              
            }}>   
              
               <div style={{
                alignSelf: 'center',
                alignItems: 'center',
                fontFamily: 'var(--mono)',
                padding: '20px',
                textAlign: 'center',
                background: '#555',
                color: '#fff', 
                display: 'flex',
                flexDirection: 'row',
              }}> 
              <img src={"favicon.ico"} width={64} style={{marginLeft: '25%'}}/>                  
              <span>JavaScript is required to run this application. Please enable JavaScript to continue.</span>
            </div>  
             
          </div>
        </noscript>
         <ThemeProvider attribute="data-theme">
           <ThemeSwitch/>
           {children}
          </ThemeProvider>
      </body>
    </html>
  );
}
