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

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

import { MatButtonModule } from '@angular/material/button';
import { MatCheckboxModule } from '@angular/material/checkbox';
import { MatFormFieldModule } from '@angular/material/form-field';
import { MatIconModule } from '@angular/material/icon';
import { MatInputModule } from '@angular/material/input';
import { MatSelectModule } from '@angular/material/select';

import { LoginComponent } from './components/login.component';

import { AccountService } from './services/account.service';

const COMPONENTS = [LoginComponent];
const SERVICES = [AccountService];

@NgModule({
  imports: [
    CommonModule,
    ReactiveFormsModule,

    FlexLayoutModule,

    MatButtonModule,
    MatCheckboxModule,
    MatFormFieldModule,
    MatIconModule,
    MatInputModule,
    MatSelectModule
  ],
  exports: [...COMPONENTS],
  declarations: [...COMPONENTS]
})
export class UCapUiAccountModule {
  public static forRoot(): ModuleWithProviders<UCapUiAccountModule> {
    return {
      ngModule: UCapUiAccountModule,
      providers: [...SERVICES]
    };
  }
}
