import { StrictMode } from "react";
import { createRoot } from "react-dom/client";
import { App } from "./app/App";

/**
 * Entry point.
 *
 * StrictMode is enabled in development so double-invoked effects surface impure
 * code early. The permanent dark theme is set on <html> in index.html before
 * this module runs, so there is no light flash while the bundle loads.
 */
const container = document.getElementById("root");

if (!container) {
  // Nothing to render into: fail loudly rather than silently showing a blank page.
  throw new Error("Micromath Admin: #root container is missing from the document.");
}

createRoot(container).render(
  <StrictMode>
    <App />
  </StrictMode>,
);
