import "@/FormTableExt/TableExt/CSSettingsV3Ext";
import { GameItemsProvider } from "@/context/GameItemsContext";
import "@/utils/ArrayExtension";
import "@/utils/NumberExtension";
import "@/utils/String";
import type { Router } from "@remix-run/router";
import dayjs from "dayjs";
import "dayjs/locale/zh-tw";
import ReactDOM from "react-dom/client";
import { RouterProvider, createHashRouter } from "react-router-dom";
import { BaseEnumerator } from "./Engine/CatanEngine/CoroutineV2/Core/BaseEnumerator";
import Game from "./UI/Game";
import Lobby from "./UI/Lobby";
import Login from "./UI/Login";
import "./index.css";

BaseEnumerator.Init();
dayjs.locale("zh-tw");
const hashRouter: Router = createHashRouter([
	{
		path: "/",
		element: <Login />,
	},
	{
		path: "/lobby",
		element: <Lobby />,
	},
	{
		path: "/game/:id",
		element: <Game />,
	},
]);

ReactDOM.createRoot(document.getElementById("root") as HTMLElement).render(
	<GameItemsProvider>
		<RouterProvider router={hashRouter} />
	</GameItemsProvider>
);
