mirror of
https://github.com/rgrgogu/new_starr.git
synced 2026-09-27 00:12:54 +08:00
integrate users
This commit is contained in:
@@ -1,8 +1,25 @@
|
||||
import { Outlet } from 'react-router-dom'
|
||||
import ProtectedRoute from '../../../routes/ProtectedRoute'
|
||||
|
||||
// Layouts
|
||||
import AdminLayout from '../layouts/AdminLayout'
|
||||
import UserManagementLayout from '../layouts/UserManagementLayout'
|
||||
|
||||
// Global Pages
|
||||
import Admin from '../pages/Admin'
|
||||
import ProfilePage from '@/components/generic/Profile'
|
||||
|
||||
// Specific Pages
|
||||
import UsersDashboard from '../pages/users/UserDashboard'
|
||||
|
||||
import UserList from '../pages/users/UserList'
|
||||
import AddUser from '../pages/users/AddUser'
|
||||
import ViewUser from '../pages/users/ViewUser'
|
||||
|
||||
import GroupList from '../pages/user_groups/GroupList'
|
||||
import ViewGroup from '../pages/user_groups/ViewGroup'
|
||||
|
||||
|
||||
export const AdminRoutes = {
|
||||
element: <ProtectedRoute allowedRoles={['admin']} />,
|
||||
children: [
|
||||
@@ -12,17 +29,37 @@ export const AdminRoutes = {
|
||||
children: [
|
||||
// Admin Management
|
||||
{ index: true, element: <Admin /> }, // /admin
|
||||
{ path: 'my-profile', element: <ProfilePage /> },
|
||||
{ path: 'my-profile', element: <ProfilePage /> },
|
||||
|
||||
// Users Management
|
||||
// {
|
||||
// path: 'users',
|
||||
// element: <UsersLayout />, // ← shared header/nav for user pages
|
||||
// children: [
|
||||
// { index: true, element: <Users /> }, // /admin/users
|
||||
// { path: 'add', element: <UsersAdd /> }, // /admin/users/add
|
||||
// { path: 'edit/:id', element: <UsersEdit /> }, // /admin/users/edit/123
|
||||
// ]
|
||||
// },
|
||||
{
|
||||
path: 'users',
|
||||
element: <UserManagementLayout />,
|
||||
children: [
|
||||
{ index: true, element: <UsersDashboard /> },
|
||||
|
||||
// User View
|
||||
{
|
||||
path: 'all',
|
||||
element: <Outlet />,
|
||||
children: [
|
||||
{ index: true, element: <UserList /> },
|
||||
{ path: 'add', element: <AddUser /> },
|
||||
{ path: 'view/:userId', element: <ViewUser /> }
|
||||
]
|
||||
},
|
||||
|
||||
// User Group View
|
||||
{
|
||||
path: 'groups',
|
||||
element: <Outlet />,
|
||||
children: [
|
||||
{ index: true, element: <GroupList /> },
|
||||
{ path: 'view/:groupId', element: <ViewGroup /> }
|
||||
]
|
||||
},
|
||||
]
|
||||
},
|
||||
|
||||
// Add here
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user