import { type ReactNode } from "react";
import { SidebarProvider, SidebarInset } from "@/components/ui/sidebar";
import { AppSidebar } from "./app-sidebar";
import { TopNav } from "./top-nav";
import { FloatingCopilot } from "./ai/copilot";

export function DashboardLayout({ children }: { children: ReactNode }) {
  return (
    <SidebarProvider>
      <div className="flex min-h-dvh w-full bg-background">
        <AppSidebar />
        <SidebarInset className="flex flex-col min-w-0">
          <TopNav />
          <main className="flex-1 min-w-0">{children}</main>
        </SidebarInset>
        <FloatingCopilot />
      </div>
    </SidebarProvider>
  );
}
