import { Inter } from 'next/font/google'
import './globals.css'
import Headers from '@/components/Headers'
import RecoilRootWrapper from './RecoilWrapper'
import UIProvider from './UIProvider'
import { headers } from 'next/headers'

const inter = Inter({ subsets: ['latin'] })

export const metadata = {
  title: 'Create Next App',
  description: 'Generated by create next app',
}

export default function RootLayout({ children }) {
  const headersList = headers()
  const headerPathname = headersList.get('x-pathname') || ''
  // console.log('headerPathname', headerPathname)

  return (
    <html lang="en">
      <body className={inter.className}>
        {headerPathname !== '/login' && <Headers />}
        <RecoilRootWrapper>
          <UIProvider>{children}</UIProvider>
        </RecoilRootWrapper>
      </body>
    </html>
  )
}
