import { createBrowserRouter, Navigate } from "react-router-dom";
import { App } from "./App";
import { CdnRefreshPage } from "../pages/cdn-refresh";
import { ConfigCenterPage } from "../pages/config-center";

export const router = createBrowserRouter([
  {
    path: "/",
    element: <App />,
    children: [
      { index: true, element: <Navigate to="/config-center" replace /> },
      { path: "config-center", element: <ConfigCenterPage /> },
      { path: "cdn-refresh", element: <CdnRefreshPage /> },
      { path: "*", element: <Navigate to="/config-center" replace /> },
    ],
  },
]);
