import React from 'react';
import { createRoot } from 'react-dom/client';
import { RouterProvider } from 'react-router-dom';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import { AuthProvider } from './auth/context';
import { router } from './router';
import '../../css/app.css';
import { initializeTheme } from '@/hooks/use-appearance';
import { OnboardingProgressProvider } from './onboarding';

initializeTheme();
const rootEl = document.getElementById('root')!;
const queryClient = new QueryClient();

createRoot(rootEl).render(
  <React.StrictMode>
    <QueryClientProvider client={queryClient}>
      <AuthProvider>
        <OnboardingProgressProvider>
          <RouterProvider router={router} />
        </OnboardingProgressProvider>
      </AuthProvider>
    </QueryClientProvider>
  </React.StrictMode>
);
