import { StrictMode } from 'react';
import { createRoot } from 'react-dom/client';

import { BrowserRouter } from 'react-router-dom';

import { App } from './App';

import { queryClient } from '@/app/services';
import { QueryClientProvider } from '@tanstack/react-query';

import { setDefaultOptions } from 'date-fns';
import { ptBR } from 'date-fns/locale';

setDefaultOptions({ locale: ptBR });

import '@/styles/index.css';
import { AuthProvider } from './app/hooks/use-auth';

createRoot(document.getElementById('root')!).render(
  <BrowserRouter>
    <QueryClientProvider client={queryClient}>
      <AuthProvider>
        <StrictMode>
          <App />
        </StrictMode>
      </AuthProvider>
    </QueryClientProvider>
  </BrowserRouter>,
);
