"use client";

import { SWRConfig } from "swr";
import { AuthProvider } from "@/lib/auth";
import { ToastProvider } from "@/components/toast";

export default function Providers({ children }: { children: React.ReactNode }) {
  return (
    <SWRConfig
      value={{
        revalidateOnFocus: true,
        refreshWhenHidden: false,
        refreshWhenOffline: false,
        dedupingInterval: 2000,
        errorRetryCount: 3,
      }}
    >
      <AuthProvider>
        <ToastProvider>{children}</ToastProvider>
      </AuthProvider>
    </SWRConfig>
  );
}
