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

import { FlexLayoutModule } from '@angular/flex-layout';

import { ScrollingModule } from '@angular/cdk/scrolling';

import { MatRippleModule } from '@angular/material';
import { MatButtonModule } from '@angular/material/button';
import { MatCardModule } from '@angular/material/card';
import { MatChipsModule } from '@angular/material/chips';
import { MatDatepickerModule } from '@angular/material/datepicker';
import { MatDividerModule } from '@angular/material/divider';
import { MatFormFieldModule } from '@angular/material/form-field';
import { MatGridListModule } from '@angular/material/grid-list';
import { MatIconModule } from '@angular/material/icon';
import { MatInputModule } from '@angular/material/input';
import { MatListModule } from '@angular/material/list';

import { MatMenuModule } from '@angular/material/menu';
import { MatButtonToggleModule } from '@angular/material/button-toggle';

import { MatMomentDateModule } from '@angular/material-moment-adapter';

import { PerfectScrollbarModule } from 'ngx-perfect-scrollbar';

import { UCapUiModule } from '@ucap-webmessenger/ui';

import { ListItemComponent } from './components/list-item.component';
import { WriteComponent } from './components/write.component';

import { ScheduleSendDialogComponent } from './dialogs/schedule-send.dialog.component';
import { TranslateModule } from '@ngx-translate/core';

const COMPONENTS = [ListItemComponent, WriteComponent];
const DIALOGS = [ScheduleSendDialogComponent];
const DIRECTIVES = [];
const SERVICES = [];

@NgModule({
  imports: [
    CommonModule,
    ReactiveFormsModule,
    FlexLayoutModule,

    ScrollingModule,

    MatRippleModule,
    MatButtonModule,
    MatCardModule,
    MatChipsModule,
    MatDatepickerModule,
    MatDividerModule,
    MatFormFieldModule,
    MatGridListModule,
    MatIconModule,
    MatInputModule,
    MatListModule,
    MatMomentDateModule,
    MatMenuModule,
    MatButtonToggleModule,

    TranslateModule,

    PerfectScrollbarModule,

    UCapUiModule
  ],
  exports: [...COMPONENTS, ...DIRECTIVES],
  declarations: [...COMPONENTS, ...DIRECTIVES, ...DIALOGS],
  entryComponents: [...DIALOGS]
})
export class UCapUiMessageModule {
  public static forRoot(): ModuleWithProviders<UCapUiMessageModule> {
    return {
      ngModule: UCapUiMessageModule,
      providers: [...SERVICES]
    };
  }
}
