"use client";

import { ChakraProvider } from "@chakra-ui/react";
import { SessionProvider } from "next-auth/react";
import { ColorModeProvider, type ColorModeProviderProps } from "./color-mode";
import { system } from "../../theme/theme";
import { Toaster } from "./feedback/toaster";
import TopLoader from "./top-loader";
import ReactQueryProvider from "@/providers/react-query-provider";
import AOSProvider from "@/providers/aos-provider";
import { PaddleProvider } from "@/lib/paddle/paddle-provider";

export function Provider(props: ColorModeProviderProps) {
  return (
    <SessionProvider>
      <ChakraProvider value={system}>
        <ReactQueryProvider>
          <PaddleProvider>
            <AOSProvider>
              <TopLoader />
              <ColorModeProvider {...props} />
              <Toaster />
            </AOSProvider>
          </PaddleProvider>
        </ReactQueryProvider>

      </ChakraProvider>

    </SessionProvider>
  );
}
