import '@/assets/globals.css'

import type {Metadata} from 'next'
import type {FunctionComponent, PropsWithChildren} from 'react'
import Navbar from '@/app/navbar'
import {getSessionProfileFromCookie} from '@/lib/sessionUtils'

export const metadata: Metadata = {
  title: 'Les 4: Voorbeeld | Backend frameworks',
  description: 'De voorbeeldcode voor les 4 van het vak Backend frameworks.',
  authors: [
    {
      name: 'Sebastiaan Henau',
    },
  ],
}

const RootLayout: FunctionComponent<PropsWithChildren> = async ({children}) => {
  const profile = await getSessionProfileFromCookie()
  return (
    <html lang="en">
      <body className="h-[100vh]">
        <Navbar profile={profile}>{children}</Navbar>
      </body>
    </html>
  )
}

export default RootLayout
