import React from "react";
import ReactDOM from "react-dom/client";
import { App as AntdApp, ConfigProvider } from "antd";
import zhCN from "antd/locale/zh_CN";
import { BrowserRouter } from "react-router-dom";

import App from "./App";
import { PlatformConfigProvider } from "./components/PlatformConfigProvider";
import "./styles/global.css";

ReactDOM.createRoot(document.getElementById("root")!).render(
  <React.StrictMode>
    <ConfigProvider
      locale={zhCN}
      theme={{
        token: {
          colorPrimary: "#1f6bff",
          borderRadius: 16,
          colorBgLayout: "#f4f7fb",
          colorText: "#162033",
          fontFamily: '"HarmonyOS Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif',
        },
      }}
    >
      <AntdApp>
        <PlatformConfigProvider>
          <BrowserRouter basename="/H5">
            <App />
          </BrowserRouter>
        </PlatformConfigProvider>
      </AntdApp>
    </ConfigProvider>
  </React.StrictMode>,
);
