import { Routes } from '@angular/router'; import { authGuard } from './core/guards/auth.guard'; import { LoginComponent } from './modules/auth/login/login.component'; import { RegisterComponent } from './modules/auth/register/register.component'; import { DashboardComponent } from './modules/dashboard/dashboard.component'; import { MainLayoutComponent } from './shared/layouts/main-layout/main-layout.component'; import { ENTITY_ROUTES } from './app.entity-routes'; import { devkitPermissionGuard } from '@devstroupe/devkit-angular'; export const routes: Routes = [ { path: 'login', component: LoginComponent }, { path: 'register', component: RegisterComponent }, { path: 'unauthorized', loadComponent: () => import('./shared/components/unauthorized/unauthorized.component').then(m => m.UnauthorizedComponent) }, { path: '', component: MainLayoutComponent, canActivate: [authGuard], children: [ { path: '', component: DashboardComponent }, { path: 'dashboard', component: DashboardComponent }, { path: 'profile', loadComponent: () => import('./modules/profile/profile.component').then(m => m.ProfileComponent) }, { path: 'playground', loadComponent: () => import('./modules/playground/playground.component').then(m => m.PlaygroundComponent) }, { path: 'role', loadComponent: () => import('./modules/role/role-permissions.component').then(m => m.RolePermissionsComponent), canActivate: [devkitPermissionGuard('manage:permissions')] }, ...ENTITY_ROUTES ] }, { path: '**', redirectTo: '' } ];