"use client";

import * as React from "react";
import { ThemeProvider as NextThemesProvider } from "next-themes";
import { type ThemeProviderProps } from "next-themes/dist/types";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";

/**
 * Providers:
 * Next-themes ThemeProvider
 * React-query QueryClientProvider
 */

const queryClient = new QueryClient();

export function Providers({ children, ...props }: ThemeProviderProps) {
  return (
    <NextThemesProvider defaultTheme="system" {...props}>
        <QueryClientProvider client={queryClient}>
          {children}
        </QueryClientProvider>
    </NextThemesProvider>
  );
}
