import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
import { createRoot } from 'react-dom/client'
import { HelmetProvider } from 'react-helmet-async'

import '@/index.css'
import App from '@/App'
import { applyClientAnimationMode, getClientAnimationMode } from '@/lib/settings'

const helmetContext = { }

const client = new QueryClient ({
    defaultOptions: {
	queries: { staleTime: 5 * 60 * 1000,
		   gcTime:    30 * 60 * 1000,
		   retry:     1 } } })

applyClientAnimationMode (getClientAnimationMode ())

createRoot (document.getElementById ('root')!).render (
    <HelmetProvider context={helmetContext}>
      <QueryClientProvider client={client}>
	<App/>
      </QueryClientProvider>
    </HelmetProvider>)
