aethex-forge/client/main.tsx
2025-12-05 01:06:47 -07:00

34 lines
818 B
TypeScript

import { StrictMode } from "react";
import { createRoot } from "react-dom/client";
import App from "./App";
import Overlay from "./pages/Overlay";
import DesktopShell from "./components/DesktopShell";
import ErrorBoundary from "./components/ErrorBoundary";
const container = document.getElementById("root");
if (!container) {
throw new Error("Root element not found");
}
const root = createRoot(container);
const hash = typeof window !== "undefined" ? window.location.hash : "";
if (hash.startsWith("#/overlay")) {
root.render(
<StrictMode>
<ErrorBoundary>
<Overlay />
</ErrorBoundary>
</StrictMode>,
);
} else {
root.render(
<StrictMode>
<ErrorBoundary>
<DesktopShell>
<App />
</DesktopShell>
</ErrorBoundary>
</StrictMode>,
);
}