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

import { AppProviders } from '@/app/providers';
import { router } from '@/app/router';

import './index.css';

const rootElement = document.getElementById('root');
if (!rootElement) {
  throw new Error(
    '#root 엘리먼트를 찾을 수 없어요. index.html을 확인해주세요.'
  );
}

createRoot(rootElement).render(
  <StrictMode>
    <AppProviders>
      <RouterProvider router={router} />
    </AppProviders>
  </StrictMode>
);
