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 min-h-screen flex-col">
      <HeaderWrapper user={session?.user} />
      <div className="flex flex-1">
        <Sidebar className="shrink-0 border-r" user={session?.user} />
        <main className="flex-1">
          {children}
        </main>
      </div>
    </div>
  );
}
