import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { ModulesComponent } from './modules.component';

const routes: Routes = [
  {
    path: '',
    component: ModulesComponent,
    children: [
      {
        path: 'dashboard',
        loadChildren: () =>
          import('./dashboard/dashboard.module').then((m) => m.DashboardModule),
      },
      {
        path: 'profile',
        loadChildren: () =>
          import('./profile/profile.module').then((m) => m.ProfileModule),
      },
      {
        path: 'teams',
        loadChildren: () =>
          import('./teams/teams.module').then((m) => m.TeamsModule),
      },
      {
        path: 'task-management',
        loadChildren: () =>
          import('./task-management/task-management.module').then(
            (m) => m.TaskManagementModule
          ),
      },
      {
        path: 'meetings',
        loadChildren: () =>
          import('./meetings/meetings.module').then((m) => m.MeetingsModule),
      },
      {
        path: 'orders',
        loadChildren: () =>
          import('./orders/orders.module').then((m) => m.OrdersModule),
      },
      {
        path: 'attendance',
        loadChildren: () =>
          import('./attendance/attendance.module').then(
            (m) => m.AttendanceModule
          ),
      },
      {
        path: 'human-resource',
        loadChildren: () =>
          import('./human-resource/human-resource.module').then(
            (m) => m.HumanResourceModule
          ),
      },
      {
        path: 'medical',
        loadChildren: () =>
          import('./medical-insurance/medical-insurance.module').then(
            (m) => m.MedicalInsuranceModule
          ),
      },
      {
        path: 'search-employee',
        loadChildren: () =>
          import('./search-employee/search-employee.module').then(
            (m) => m.SearchEmployeeModule
          ),
      },
      {
        path: 'chat',
        loadChildren: () =>
          import('./chat/chat.module').then((m) => m.ChatModule),
      },
      {
        path: 'contracts',
        loadChildren: () =>
          import('./contracts/contracts.module').then((m) => m.ContractsModule),
      },
      {
        path: '',
        redirectTo: 'dashboard',
        pathMatch: 'full',
      },
    ],
  },
];

@NgModule({
  imports: [RouterModule.forChild(routes)],
  exports: [RouterModule],
})
export class ModulesRoutingModule {}
