import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { DeviceComponent } from './device.component';
import { RouterModule } from '@angular/router';
import { NgxDatatableModule } from '@swimlane/ngx-datatable';

import { NgSelectModule } from '@ng-select/ng-select';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { ClipboardModule } from 'ngx-clipboard';
import { CardModule } from '../../partials/general/card/card.module';
import { BreadcrumbModule } from 'src/app/_layout/breadcrumb/breadcrumb.module';
import { BlockUIModule } from 'ng-block-ui';
import { BlockTemplateComponent } from '../../../_layout/blockui/block-template.component';
import { PerfectScrollbarModule } from 'ngx-perfect-scrollbar';
import { AddEditDeviceComponent } from './add-edit-device/add-edit-device.component';
import { ModalAddEditComponent } from './modal-add-edit/modal-add-edit.component';



@NgModule({
  declarations: [
    DeviceComponent,
    AddEditDeviceComponent,
    ModalAddEditComponent
  ],
  imports: [
    CommonModule,
    CardModule,
    BreadcrumbModule,
    NgSelectModule,
    FormsModule,
    ReactiveFormsModule,
    ClipboardModule,
    PerfectScrollbarModule,
    NgxDatatableModule,
    BlockUIModule.forRoot({
      template: BlockTemplateComponent
    }),
    RouterModule.forChild([
      {
        path: '',
        component: DeviceComponent
      },
      {
        path: 'add-row',
        component: AddEditDeviceComponent,
        data: { mode: 'add' }
      },
      {
        path: 'edit/:id',
        component: AddEditDeviceComponent,
        data: { mode: 'edit' } 
      },
      {
        path: 'view/:id',
        component: AddEditDeviceComponent,
        data: { mode: 'view' } 
      }
    ])
  ]
})
export class DeviceModule { }
