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 Source from "@/pages/source/source";
import Menu from "@/pages/menu";
import Role from "@/pages/role";
import Permission from "@/pages/permission";

const routers = createHashRouter([
  {
    path: "/",
    element: <LayOut />,
    children: [
      {
        path: "/",
        index: true,
        element: <Dashbord />,
      },
      {
        path: "/user/list",
        index: true,
        element: <User />,
      },
      {
        path: "/source/list",
        index: true,
        element: <Source />,
      },
      {
        path: "/permi/permi",
        index: true,
        element: <Permission />,
      }, {
        path: "/permi/dep",
        index: true,
        element: <Permission />,
      },
      {
        path: "/permi/menu",
        index: true,
        element: <Menu />,
      },
      {
        path: "/permi/role",
        index: true,
        element: <Role />,
      },
    ],
  },
  {
    path: "/login",
    element: <Login />,
  },
]);

export { routers };
