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

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

@NgModule({
  declarations: [
    CreateUserRouter,
    CreateUserContainer,
    FormComponent,
    ListComponent,
    SearchComponent
  ],
  imports: [
    CommonModule,
    SharedModule,
    RouterModule.forChild(routes),
  ]
})
export class CreateUserModule { }
