import { getCurrentUser } from "@/lib/auth";
import { SidebarClient } from "@/components/sidebar.client";

export default async function DashboardLayout({
  children,
}: {
  children: React.ReactNode;
}) {
  const user = await getCurrentUser();
  const email = user?.email ?? "";
  const isSuper = user?.role === 'super';

  return (
    <div className="grid min-h-screen grid-cols-[16rem_1fr] bg-gray-50">
      <SidebarClient email={email} isSuper={isSuper} />
      <main className="p-6">{children}</main>
    </div>
  );
}
