import { requireRole } from '@/lib/auth-redirect'
import { ObserverNav } from '@/components/layouts/observer-nav'

export default async function ObserverLayout({
  children,
}: {
  children: React.ReactNode
}) {
  const session = await requireRole('OBSERVER')

  return (
    <div className="min-h-screen bg-background">
      <ObserverNav
        user={{
          name: session.user.name,
          email: session.user.email,
        }}
      />
      <main className="container-app py-6">{children}</main>
    </div>
  )
}
