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, createBrowserRouter, createHashRouter } from "react-router-dom";
import { BaseEnumerator } from "./Engine/CatanEngine/CoroutineV2/Core/BaseEnumerator";
import Lobby from "./UI/Lobby";
import Login from "./UI/Login";
import { ModalProvider } from "./UIControl/ModalContext";
import "./index.css";
import "./utils/catan";

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

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