import React from "react";
import ReactDOM from "react-dom/client";
import { BrowserRouter } from "react-router-dom";

import App from "./App";
import { ThemeToggle } from "./components/ThemeToggle";
import { PortalSessionProvider } from "./context/PortalSessionContext";
import { initializeUiTheme } from "./lib/theme";
import "./styles.css";

initializeUiTheme();

ReactDOM.createRoot(document.getElementById("root")!).render(
  <React.StrictMode>
    <PortalSessionProvider>
      <BrowserRouter>
        <>
          <App />
          <ThemeToggle />
        </>
      </BrowserRouter>
    </PortalSessionProvider>
  </React.StrictMode>
);
