import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import {SharedModule} from '../../../shared/shared.module';
import {RouterModule, Routes} from '@angular/router';
import { SetUserRouter } from './router/router';
import { SetUserContainer } from './container/set-user/set-user.container';
import { SearchComponent } from './presenter/search/search/search.component';
import { ListComponent } from './presenter/list/list/list.component';
import { FormComponent } from './presenter/form/form/form.component';

const routes: Routes = [
  {
    path: '',
    component: SetUserRouter,
    children: [
      {
        path: '',
        component: SetUserContainer
      },
      {
        path: 'add',
        component: FormComponent
      },
      {
        path: 'edit/:id',
        component: FormComponent
      }
    ]
  }
];

@NgModule({
  declarations: [
    SetUserRouter,
    SetUserContainer,
    SearchComponent,
    ListComponent,
    FormComponent
  ],
  imports: [
    CommonModule,
    SharedModule,
    RouterModule.forChild(routes),
  ]
})
export class SetUserModule { }
