import React, { Suspense, lazy } from 'react';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
const ReactQueryDevtools = lazy(() => import('@tanstack/react-query-devtools').then((m) => ({ default: m.ReactQueryDevtools })));
const queryClient = new QueryClient({
    defaultOptions: {
        queries: {
            staleTime: 5 * 60_000,
            gcTime: 10 * 60_000,
            retry: 1,
            refetchOnWindowFocus: false,
        },
    },
});
export const QueryProvider = ({ children, showDevTools = false }) => {
    return (React.createElement(QueryClientProvider, { client: queryClient }, children, showDevTools && (React.createElement(Suspense, { fallback: null }, React.createElement(ReactQueryDevtools, { initialIsOpen: false })))));
};
//# sourceMappingURL=QueryProvider.js.map