mirror of
https://github.com/d0zingcat/alert-message-center.git
synced 2026-05-24 07:26:52 +00:00
21 lines
578 B
TypeScript
21 lines
578 B
TypeScript
import React from "react";
|
|
import ReactDOM from "react-dom/client";
|
|
import App from "./App.tsx";
|
|
import { AuthProvider } from "./contexts/AuthContext.tsx";
|
|
import AuthCallback from "./views/AuthCallback.tsx";
|
|
import "./index.css";
|
|
|
|
// Simple routing based on pathname
|
|
const pathname = window.location.pathname;
|
|
|
|
const rootElement = document.getElementById("root");
|
|
if (rootElement) {
|
|
ReactDOM.createRoot(rootElement).render(
|
|
<React.StrictMode>
|
|
<AuthProvider>
|
|
{pathname === "/auth/callback" ? <AuthCallback /> : <App />}
|
|
</AuthProvider>
|
|
</React.StrictMode>,
|
|
);
|
|
}
|