import { StrictMode } from "react";
import { createRoot } from "react-dom/client";
import "./styles/design-system.css";
import "swiper/swiper-bundle.css";
import "flatpickr/dist/flatpickr.css";
import App from "./App";
import { ThemeProvider } from "./context/ThemeContext";
import { ToastProvider } from "./components/ui/toast/ToastContainer";
import { HeaderMetricsProvider } from "./context/HeaderMetricsContext";
import { ErrorBoundary } from "./components/common/ErrorBoundary";
import { BrowserRouter } from "react-router-dom";

createRoot(document.getElementById("root")!).render(
  <StrictMode>
    <ErrorBoundary>
      <ThemeProvider>
        <HeaderMetricsProvider>
          <ToastProvider>
            <BrowserRouter>
              <App />
            </BrowserRouter>
          </ToastProvider>
        </HeaderMetricsProvider>
      </ThemeProvider>
    </ErrorBoundary>
  </StrictMode>,
);
