import type { Metadata, Viewport } from 'next';
import Script from 'next/script';
import { MUIThemeProvider } from '@/shared/lib/theme-provider';
import { ReactQueryProvider } from '@/shared/lib/react-query-provider';
import { AuthProvider } from '@/features/auth';
import '@/styles/globals.css';

export const metadata: Metadata = {
  title: 'KT AI 이벤트 마케팅',
  description: '소상공인을 위한 AI 기반 이벤트 자동 생성 서비스',
};

export const viewport: Viewport = {
  width: 'device-width',
  initialScale: 1,
  maximumScale: 1,
  themeColor: '#E31E24',
};

export default function RootLayout({
  children,
}: {
  children: React.ReactNode;
}) {
  return (
    <html lang="ko">
      <head>
        <link
          rel="stylesheet"
          href="https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable.min.css"
        />
        <link
          rel="stylesheet"
          href="https://fonts.googleapis.com/icon?family=Material+Icons"
        />
      </head>
      <body>
        <Script src="/runtime-env.js" strategy="beforeInteractive" />
        <MUIThemeProvider>
          <ReactQueryProvider>
            <AuthProvider>
              {children}
            </AuthProvider>
          </ReactQueryProvider>
        </MUIThemeProvider>
      </body>
    </html>
  );
}
