import { Routes } from '@angular/router';
import { adminGuard } from '../../core/guards';

export const WORKFLOWS_ROUTES: Routes = [
  {
    path: '',
    loadComponent: () =>
      import('./workflow-list/workflow-list.component').then((m) => m.WorkflowListComponent),
    canActivate: [adminGuard],
  },
  {
    path: 'new',
    loadComponent: () =>
      import('./workflow-form/workflow-form.component').then((m) => m.WorkflowFormComponent),
    canActivate: [adminGuard],
  },
  {
    path: 'builder',
    loadComponent: () =>
      import('./workflow-builder/workflow-builder.component').then(
        (m) => m.WorkflowBuilderComponent
      ),
    canActivate: [adminGuard],
  },
  {
    path: 'builder/:id',
    loadComponent: () =>
      import('./workflow-builder/workflow-builder.component').then(
        (m) => m.WorkflowBuilderComponent
      ),
    canActivate: [adminGuard],
  },
  {
    path: ':id',
    loadComponent: () =>
      import('./workflow-preview/workflow-preview.component').then(
        (m) => m.WorkflowPreviewComponent
      ),
    canActivate: [adminGuard],
  },
  {
    path: ':id/edit',
    loadComponent: () =>
      import('./workflow-form/workflow-form.component').then((m) => m.WorkflowFormComponent),
    canActivate: [adminGuard],
  },
];
