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

import { MenuItems } from './menu-items/menu-items';
import { MenuItemsService } from './menu-items/menu-items.service';
import {
  UserComponent, UserDialogComponent, UserDetailsComponent
} from './user';
import { UsersService } from './user/users.service';
import { AccordionAnchorDirective, AccordionLinkDirective, AccordionDirective } from './accordion';
import { ToggleFullscreenDirective } from './fullscreen/toggle-fullscreen.directive';
import { MaterialModule } from '@angular/material';
import { FlexLayoutModule, MediaQueriesModule } from '@angular/flex-layout';
import { CommonModule } from '@angular/common';
import { TranslateModule } from 'ng2-translate/ng2-translate';

@NgModule({
  imports: [MaterialModule, FlexLayoutModule, MediaQueriesModule, CommonModule, TranslateModule],
  declarations: [AccordionAnchorDirective, AccordionLinkDirective, AccordionDirective,
    ToggleFullscreenDirective,
    UserComponent, UserDialogComponent, UserDetailsComponent],
  exports: [AccordionAnchorDirective, AccordionLinkDirective, AccordionDirective,
    ToggleFullscreenDirective,
    UserComponent, UserDialogComponent, UserDetailsComponent],
  providers: [MenuItems, UsersService, MenuItemsService],
  entryComponents: [UserDialogComponent]
})
export class SharedModule {
  static forRoot(): ModuleWithProviders {
    return {
      ngModule: SharedModule,
      providers: [UsersService]
    };
  }
}
