import { AuthProvider } from "@/contexts/AuthContext";
import { MenuProvider } from "@/contexts/MenuContext";
import { MessengerProvider } from "@/contexts/MessengerContext";
import { AppLayout } from "@/components/layout/AppLayout";
import { ApprovalGlobalListener } from "@/components/approval/ApprovalGlobalListener";
import { MessengerFAB } from "@/components/messenger/MessengerFAB";
import { MessengerModal } from "@/components/messenger/MessengerModal";

export default function MainLayout({ children }: { children: React.ReactNode }) {
  return (
    <AuthProvider>
      <MenuProvider>
        <MessengerProvider>
          <AppLayout>{children}</AppLayout>
          <ApprovalGlobalListener />
          <MessengerFAB />
          <MessengerModal />
        </MessengerProvider>
      </MenuProvider>
    </AuthProvider>
  );
}
