The src/app/tabs/main.tsx file serves as the entrypoint for the Tabs application. It initializes a React application using ReactDOM.createRoot and configures client-side routing using react-router-dom's createHashRouter.
The application is mounted to the DOM element with the ID root. The router defines the following top-level routes:
/ai: Renders the AI component./login: Renders the Login component./register: Renders the Register component.
Note that because it uses createHashRouter, the application URLs will follow the hash pattern (e.g., /#/ai, /#/login).
import ReactDOM from "react-dom/client";
import { createHashRouter, RouterProvider } from "react-router-dom";
import { AI } from "./ai";
import { Login } from "./login";
import { Register } from "./register";
const router = createHashRouter([
{
children: [
{
path: "ai",
element: <AI />,
},
{
path: "login",
element: <Login />,
},
{
path: "register",
element: <Register />,
},
],
},
]);
ReactDOM.createRoot(document.getElementById("root") as HTMLElement).render(
<RouterProvider router={router} />,
);