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

import { BIXI_TABLE_CONFIG, EStatus, IBixiTableConfig } from '@bixi/core/table';
import { SharedModule } from '@shared/shared.module';
import { NzRateComponent, NzRateModule } from 'ng-zorro-antd/rate';
import { NzTableModule } from 'ng-zorro-antd/table';
import { NzTagModule } from 'ng-zorro-antd/tag';
import { COMPONENTS } from './components';
import { IdeaRoutingModule } from './idea-routing.module';
import { IdeComponent } from './idea.component';
import { PAGES } from './pages';

const bixiTableConfig: IBixiTableConfig = {
  status: {
    danger: EStatus.error,
    success: EStatus.success,
    typeA: {
      text: 'typeA_TEXT',
      style: {
        backgroundColor: 'pink',
        color: 'white'
      }
    },
    typeB: {
      text: 'typeB_TEXT',
      className: 'TOKEN_CLASSNAME_TEST'
    }
  }
};

const ZorroModules = [
  NzTableModule,
  NzRateModule,
  NzTagModule
];

@NgModule({
  imports: [
    SharedModule,
    IdeaRoutingModule,
    ...ZorroModules
  ],
  declarations: [
    ...COMPONENTS,
    ...PAGES,
    IdeComponent
  ],
  providers: [
    {
      provide: BIXI_TABLE_CONFIG,
      useValue: bixiTableConfig
    }
  ],
  entryComponents: [
    NzRateComponent
  ]
})
export class IdeaModule {
}
