import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import type { FC } from "react";

const queryClient = new QueryClient();

export default function withQueryClient<T extends object>(Component: FC<T>) {
  return function HOC(props: T) {
    return (
      <QueryClientProvider client={queryClient}>
        <Component {...props} />
      </QueryClientProvider>
    );
  };
}
