import { AdminSidebar } from "@/components/admin/AdminSidebar";
import { getServerSession } from "next-auth";
import { authOptions } from "@/lib/auth";

export default async function AdminLayout({
  children,
}: {
  children: React.ReactNode;
}) {
  const session = await getServerSession(authOptions);
  return (
    <div className="flex min-h-screen bg-gray-50">
      {session && <AdminSidebar />}
      <main className="flex-1 px-8 py-8 overflow-y-auto">
        {children}
      </main>
    </div>
  );
}
