import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';

const routes: Routes = [
  {
    path: '',
    redirectTo: 'personal',
    pathMatch: 'full',
  },
  {
    path: 'personal',
    data: { title: 'Hantera personal' },
    loadChildren: () => import('./pages/employees/employees.module').then(m => m.EmployeesModule),
  },
  {
    path: 'personal/:employeeId',
    data: { title: 'Personalkonto' },
    loadChildren: () => import('./pages/employee-card/employee-card.module').then(m => m.EmployeeCardModule),
  },
  {
    path: 'skapa-personalkonto',
    data: { title: 'Skapa personalkonto' },
    loadChildren: () => import('./pages/employee-invite/employee-invite.module').then(m => m.EmployeeInviteModule),
  },
  {
    path: 'redigera-personalkonto/:employeeId',
    data: { title: 'Redigera personalkonto' },
    loadChildren: () => import('./pages/employee-form/employee-form.module').then(m => m.EmployeeFormModule),
  },
];

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