import { HeaderWrapper } from "@/components/header-wrapper";
import { Sidebar } from "@/components/sidebar";
import { auth } from "@/auth";

export default async function MainLayout({
  children,
}: Readonly<{
  children: React.ReactNode;
}>) {
  const session = await auth();

  return (
    <div className="flex h-screen flex-col">
      <HeaderWrapper user={session?.user} />
      <div className="flex flex-1 overflow-hidden">
        <Sidebar className="shrink-0 border-r overflow-y-auto" user={session?.user} />
        <main className="flex-1 overflow-y-auto">
          {children}
        </main>
      </div>
    </div>
  );
}
