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

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

import { MatFormFieldModule } from '@angular/material/form-field';
import { MatIconModule } from '@angular/material/icon';
import { MatInputModule } from '@angular/material/input';
import { MatButtonModule } from '@angular/material/button';
import { MatMenuModule } from '@angular/material/menu';

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

import { FormComponent } from './components/form.component';
import { MessagesComponent } from './components/messages.component';

import { DateSplitterComponent as MBDateSplitterComponent } from './components/message-box/date-splitter.component';
import { FileComponent as MBFileComponent } from './components/message-box/file.component';
import { AttachFileComponent as MAttachFileComponent } from './components/message-box/attach-file.component';
import { ImageComponent as MBImageComponent } from './components/message-box/image.component';
import { InformationComponent as MBInformationComponent } from './components/message-box/information.component';
import { MassTranslationComponent as MBMassTranslationComponent } from './components/message-box/mass-translation.component';
import { MassComponent as MBMassComponent } from './components/message-box/mass.component';
import { NoticeComponent as MBNoticeComponent } from './components/message-box/notice.component';
import { RecallComponent as MBRecallComponent } from './components/message-box/recall.component';
import { ScheduleComponent as MBScheduleComponent } from './components/message-box/schedule.component';
import { StickerComponent as MBStickerComponent } from './components/message-box/sticker.component';
import { TextComponent as MBTextComponent } from './components/message-box/text.component';
import { TranslationComponent as MBTranslationComponent } from './components/message-box/translation.component';
import { VideoComponent as MBVideoComponent } from './components/message-box/video.component';
import { VideoConferenceComponent as MBVideoConferenceComponent } from './components/message-box/video-conference.component';

const COMPONENTS = [
  FormComponent,
  MessagesComponent,

  MBDateSplitterComponent,
  MBFileComponent,
  MAttachFileComponent,
  MBImageComponent,
  MBInformationComponent,
  MBMassTranslationComponent,
  MBMassComponent,
  MBNoticeComponent,
  MBRecallComponent,
  MBScheduleComponent,
  MBStickerComponent,
  MBTextComponent,
  MBTranslationComponent,
  MBVideoComponent,
  MBVideoConferenceComponent
];
const SERVICES = [];
const PROVIDERS = [DatePipe];

@NgModule({
  imports: [
    CommonModule,
    FormsModule,
    ReactiveFormsModule,
    FlexLayoutModule,
    MatFormFieldModule,
    MatIconModule,
    MatInputModule,
    MatButtonModule,
    MatMenuModule,

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