import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import { RouterProvider } from 'react-router-dom';
import Internationalization from './components/internaltionalization';
import { createRouter } from './router/createRouter';

import 'antd/dist/reset.css';
import './styles/override.css';

const queryClient = new QueryClient({
  defaultOptions: {
    queries: {
      cacheTime: 30_000,
      staleTime: 10_000,
      refetchOnWindowFocus: false,
    },
  },
});

function App() {
  const router = createRouter();

  return (
    <QueryClientProvider client={queryClient}>
      <Internationalization>
        <RouterProvider router={router} />
      </Internationalization>
    </QueryClientProvider>
  );
}

export default App;
