import { createHashRouter } from "react-router-dom";
import LayOut from "@/components/layout/layout";
import Login from "@/pages/login/login";
import User from "@/pages/user/user";
import Dashbord from "@/pages/dashbord";
import { rbac } from "./routers/rbac_router";
import { sku } from "./routers/sku_router";
import Order from "@/pages/order";

const routers = createHashRouter([
  {
    path: "/",
    element: <LayOut />,
    children: [
      {
        path: "/",
        index: true,
        element: <Dashbord />,
      },
      {
        path: "/user/list",
        index: true,
        element: <User />,
      },
      ...rbac,
      ...sku,
      {
        path: "/order/list",
        index: true,
        element: <Order />,
      },
    ],
  },
  {
    path: "/login",
    element: <Login />,
  },
]);

export { routers };
