import { Header } from "@/features/layout/components/header";
import { Sidebar } from "@/features/layout/components/sidebar";
import { createClient } from "@/utils/supabase/server";

export default async function MainLayout({
  children,
}: {
  children: React.ReactNode;
}) {
  const supabase = await createClient();
  const {
    data: { user },
  } = await supabase.auth.getUser();

  return (
    <div className="flex min-h-screen flex-col bg-zinc-50 dark:bg-black">
      <Header user={user} />
      <div className="flex flex-1">
        <Sidebar />
        <main className="flex-1 w-full p-6 md:p-8 lg:p-10">{children}</main>
      </div>
    </div>
  );
}
