// MUI Imports
import InitColorSchemeScript from '@mui/material/InitColorSchemeScript'

// Third-party Imports
import 'react-perfect-scrollbar/dist/css/styles.css'

// Type Imports
import type { ChildrenType } from '@core/types'

// Util Imports
import { getSystemMode } from '@core/utils/serverHelpers'

// Style Imports
import '@/app/globals.css'

// Generated Icon CSS Imports
import '@assets/iconify-icons/generated-icons.css'

// Font Imports
import { iran_sans } from '@core/theme'

// Config Imports
import { getMetadata } from '@configs/metadata'

export const metadata = getMetadata()

const RootLayout = async (props: ChildrenType) => {
  const { children } = props
  

  // Vars
  const systemMode = await getSystemMode()
  const direction = 'rtl' // Fixed RTL direction

  return (
    <html id='__next' dir={direction} className={iran_sans.className} suppressHydrationWarning>
      <body className='flex is-full min-bs-full flex-auto flex-col'>
        <InitColorSchemeScript attribute='data' defaultMode={systemMode} />
        {children}
      </body>
    </html>
  )
}

export default RootLayout

