import {StrictMode} from 'react'
import {createRoot} from 'react-dom/client'
import './main.css'
import {QueryClient, QueryClientProvider} from '@tanstack/react-query'
import Routing from '@/routing/routing.tsx'
import {BrowserRouter} from 'react-router'

const queryClient = new QueryClient({
  defaultOptions: {
    queries: {
      refetchOnWindowFocus: process.env.NODE_ENV === 'development',
      retry: false,
    },
  },
})

createRoot(document.getElementById('root')!).render(
  <StrictMode>
    <QueryClientProvider client={queryClient}>
      <BrowserRouter>
        <div className="m-6">
          <Routing />
        </div>
      </BrowserRouter>
    </QueryClientProvider>
  </StrictMode>,
)
