"use client";

import { PropsWithChildren, useState } from "react";
import { QueryClient, QueryClientProvider } from "react-query";
import { ThemeProvider } from "@/providers/theme/ThemeProvider";
import { AnalyticsProvider } from "@/providers/analytics/AnalyticsProvider";
import { MockAuthProvider } from "@/providers/auth/MockAuthProvider";

export function AppProviders({ children }: PropsWithChildren) {
  const [queryClient] = useState(() => new QueryClient());

  return (
    <QueryClientProvider client={queryClient}>
      <ThemeProvider>
        <MockAuthProvider>
          <AnalyticsProvider>{children}</AnalyticsProvider>
        </MockAuthProvider>
      </ThemeProvider>
    </QueryClientProvider>
  );
}
