import { auth } from "@/auth";
import { HomeDock } from "../home-dock";

export default async function MainLayout({
  children,
}: {
  children: React.ReactNode;
}) {
  const session = await auth();
  const user = session?.user as { role?: string } | undefined;
  const isAdmin = user?.role === "admin";

  return (
    <div className="min-h-screen bg-gradient-to-br from-background via-background to-muted/40">
      <main className="mx-auto max-w-6xl px-4 pt-8 pb-32 sm:px-6 sm:pt-12 lg:px-8">
        {children}
      </main>
      <HomeDock isAuthenticated={!!session?.user} isAdmin={isAdmin} />
    </div>
  );
}
