import { Routes } from '@angular/router';
import { basicRoutes } from './basic/basic.route';
import { hazardRoutes } from './hazard/hazard.route';
import { riskRoutes } from './risk/risk.route';
import { userRoutes } from './user/user.route';
import { workbenchRoutes } from './workbench/workbench.route';

export const managerRoutes: Routes = [
  {
    path: 'workbench',
    loadComponent: () => import('./workbench/workbench.component').then(m => m.WorkbenchComponent),
    children: workbenchRoutes,
    data: {
      title: '工作台',
      icon: 'user',
      weight: 0,
    },
  },
  {
    path: 'basic-data',
    loadComponent: () => import('./basic/basic.component').then(m => m.BasicComponent),
    children: basicRoutes,
    data: {
      title: '基础数据管理',
      icon: 'user',
      weight: 0,
    },
  },
  {
    path: 'user',
    loadComponent: () => import('./user/user.component').then(m => m.UserComponent),
    children: userRoutes,
    data: {
      title: '用户管理',
      icon: 'user',
      weight: 0,
    },
  },

  {
    path: 'risk',
    loadComponent: () => import('./risk/risk.component').then(m => m.RiskControlComponent),
    children: riskRoutes,
    data: {
      title: '风险管控',
    },
  },
  {
    path: 'potential-hazard',
    loadComponent: () => import('./hazard/hazard.component').then(m => m.HazardComponent),
    children: hazardRoutes,
    data: {
      title: '隐患管理',
    },
  },
  { path: '', pathMatch: 'full', redirectTo: 'workbench' },
];
