// React is used implicitly by JSX
import ReactDOM from "react-dom/client";
import "@styles/global.css";
import { Root } from "@app/root";

// Wait for DOM to be ready
document.addEventListener("DOMContentLoaded", () => {
  const rootElement = document.getElementById("root");

  if (!rootElement) {
    console.error("Root element not found!");
    return;
  }

  try {
    const root = ReactDOM.createRoot(rootElement);

    root.render(<Root />);

    console.log("React application successfully mounted");
  } catch (error) {
    console.error("Failed to render React application:", error);
  }
});
