import { StrictMode } from "react";
import { createRoot } from "react-dom/client";
import "./output.css";
import App from "./App.tsx";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import { GlobalContextProvider } from "./Context.tsx";
import { BrowserRouter } from "react-router-dom";
import { ConfigProvider } from "antd";
import zhCN from "antd/locale/zh_CN";
const webBaseUrl = import.meta.env.VITE_WEB_BASE_URL;
// 创建 QueryClient 实例
const queryClient = new QueryClient({
  defaultOptions: {
    queries: {
      gcTime: 10 * 60 * 1000,
      retry: 1,
      refetchOnWindowFocus: false,
    },
    mutations: {
      retry: 1,
    },
  },
});
const theme = {
  token: {
    colorPrimary: '#52c41a', // 这是 antd 默认的蓝色，你可以改成任何你想要的颜色，比如 '#52c41a' (绿色)
  },
};

createRoot(document.getElementById("root")!).render(
  <StrictMode>
    <QueryClientProvider client={queryClient}>
      <GlobalContextProvider>
        <ConfigProvider locale={zhCN} theme={theme}>
          <BrowserRouter basename={webBaseUrl}>
            <App />
          </BrowserRouter>
        </ConfigProvider>
      </GlobalContextProvider>
    </QueryClientProvider>
  </StrictMode>
);
