import type { Metadata } from 'next'
import { Figtree } from 'next/font/google'
import { ThemeInit } from '../.flowbite-react/init'
import { AuthProvider } from '@/lib/context/AuthContext'
import './globals.css'
import '@/lib/config/echo'
import 'quill/dist/quill.core.css'
import 'quill/dist/quill.snow.css'
import { NotificationProvider } from '@/lib/context/NotificationContext'
import { ThemeProvider } from 'flowbite-react'
import rootTheme from '@/lib/themes/root'

const figtree = Figtree({
  variable: '--font-figtree',
  subsets: ['latin'],
})

export const metadata: Metadata = {
  applicationName: 'BALI RSV BES Admin',
  generator: 'Next.js',
  title: {
    template: '%s | BALI RSV BES Admin',
    default: 'Dashboard',
  },
  robots: {
    index: false,
    follow: false,
  },
  authors: [
    {
      name: 'BALI RSV Developer',
    },
  ],
}

export default function RootLayout({
  children,
}: Readonly<{
  children: React.ReactNode
}>) {
  return (
    <html lang="en">
      <head>
        <ThemeInit />
      </head>
      <body className={figtree.className}>
        <ThemeProvider theme={rootTheme}>
          <AuthProvider>
            <NotificationProvider>{children}</NotificationProvider>
          </AuthProvider>
        </ThemeProvider>
      </body>
    </html>
  )
}
