import { NgModule, ModuleWithProviders } from '@angular/core';
import { CommonModule } from '@angular/common';

import { MatButtonModule } from '@angular/material/button';
import { MatCardModule } from '@angular/material/card';
import { MatDialogModule } from '@angular/material/dialog';

import { DragDropModule } from '@angular/cdk/drag-drop';

import { BottomSheetService } from './services/bottom-sheet.service';
import { DialogService } from './services/dialog.service';
const SERVICES = [BottomSheetService, DialogService];

import { AlertDialogComponent } from './dialogs/alert.dialog.component';
import { ConfirmDialogComponent } from './dialogs/confirm.dialog.component';
const DIALOGS = [AlertDialogComponent, ConfirmDialogComponent];

@NgModule({
  imports: [
    CommonModule,
    MatButtonModule,
    MatCardModule,
    MatDialogModule,
    DragDropModule
  ],
  exports: [],
  declarations: [...DIALOGS],
  entryComponents: [...DIALOGS]
})
export class UCapUiModule {
  public static forRoot(): ModuleWithProviders<UCapUiModule> {
    return {
      ngModule: UCapUiModule,
      providers: [...SERVICES]
    };
  }
}
