import { createBrowserRouter } from "react-router-dom";
import { SUPERADMIN_ROLES, ADMIN_ROLES } from "../constants/roles";
import { LoginPage } from "../pages/login_page/login_page";
import { ProtectedRoute } from "./protected_route";
import { SuperAdminHomePage } from "../pages/home/super_admin_page/super_admin_home_page";

export const router = createBrowserRouter([
  {
    element: <ProtectedRoute allowedRoles={ADMIN_ROLES}/>,
    children: [
      {
        index: true,
        path: "/",
        element: <SuperAdminHomePage/>
      }
    ]
  },
  {
    element: <LoginPage/>,
    children: [
      {
        path: "/login",
        element: <LoginPage/>
      }
    ]
  }
]);