import { NgModule, NO_ERRORS_SCHEMA } from '@angular/core';
import { NativeScriptCommonModule } from '@nativescript/angular';
import { NgxsModule } from '@ngxs/store';
import { NativeScriptUIDataFormModule } from 'nativescript-ui-dataform/angular';
import { NativeScriptUIListViewModule } from 'nativescript-ui-listview/angular';
import { SubordinateUnitsComponent } from '~/pages/unit/components/subordinate-units/subordinate-units.component';
import { UnitContactsComponent } from '~/pages/unit/components/unit-contacts/unit-contacts.component';
import { UnitFunctionPersonComponent } from '~/pages/unit/components/unit-function-person/unit-function-person.component';
import { UnitFunctionsListViewComponent } from '~/pages/unit/components/unit-functions-list-view/unit-functions-list-view.component';
import { UnitInfoComponent } from '~/pages/unit/components/unit-info/unit-info.component';
import { UnitMembersListViewComponent } from '~/pages/unit/components/unit-members-list-view/unit-members-list-view.component';
import { UnitStatsMembersAgeComponent } from '~/pages/unit/components/unit-stats-members-age/unit-stats-members-age.component';
import { UnitStatsMembersCategoryComponent } from '~/pages/unit/components/unit-stats-members-category/unit-stats-members-category.component';
import { UnitStatsMembersSumComponent } from '~/pages/unit/components/unit-stats-members-sum/unit-stats-members-sum.component';
import { UnitStatsSubordinateUnitsComponent } from '~/pages/unit/components/unit-stats-subordinate-units/unit-stats-subordinate-units.component';
import { UnitFunctionsComponent } from '~/pages/unit/containers/unit-functions/unit-functions.component';
import { UnitMembersComponent } from '~/pages/unit/containers/unit-members/unit-members.component';
import { UnitStatsComponent } from '~/pages/unit/containers/unit-stats/unit-stats.component';
import { UnitComponent } from '~/pages/unit/containers/unit/unit.component';
import { WebApiUnitMembersService } from '~/pages/unit/services/web-api-unit-members.service';
import { UnitDetailState } from '~/pages/unit/state-mgmt/unit-detail.state';
import { UnitFunctionsState } from '~/pages/unit/state-mgmt/unit-functions.state';
import { UnitMembershipsState } from '~/pages/unit/state-mgmt/unit-memberships.state';
import { UnitStatsState } from '~/pages/unit/state-mgmt/unit-stats.state';
import { UnitRoutingModule } from '~/pages/unit/unit-routing.module';
import { UnitService } from '~/shared/services/unit.service';
import { SharedModule } from '~/shared/shared.module';
import { DisappearingScrollActionBarComponent } from '../event/components/common/disappearing-scroll-action-bar/disappearing-scroll-action-bar.component';
import { EventListItemHeaderComponent } from '../event/components/common/event-list-item-header/event-list-item-header.component';
import { InfoLineComponent } from '../event/components/common/info-line/info-line.component';
import { ScrollTopBarListComponent } from '../event/components/common/scroll-top-bar-list/scroll-top-bar-list.component';
import { SortModalComponent } from '../event/components/common/sort-modal/sort-modal.component';
import { EventModule } from '../event/event.module';
import { UnitListViewComponent } from './components/unit-list/unit-list-view.component';
import { UnitSearchModalComponent } from './components/unit-search-modal/unit-search-modal.component';
import { UnitListPageComponent } from './containers/unit-list-page/unit-list-page.component';
import { UnitSearchState } from './state-mgmt/unit-search.state';
import { UnitLandingComponent } from './containers/unit-landing/unit-landing.component';

@NgModule({
    imports: [
        NativeScriptCommonModule,
        NativeScriptUIDataFormModule,
        NativeScriptUIListViewModule,
        UnitRoutingModule,
        SharedModule,
        EventModule,
        NgxsModule.forFeature([
            UnitDetailState,
            UnitFunctionsState,
            UnitMembershipsState,
            UnitStatsState,
            UnitSearchState,
        ])
    ],
    declarations: [
        UnitComponent,
        UnitMembersComponent,
        UnitFunctionsComponent,
        SubordinateUnitsComponent,
        UnitInfoComponent,
        UnitContactsComponent,
        UnitFunctionPersonComponent,
        UnitFunctionsListViewComponent,
        UnitMembersListViewComponent,
        UnitStatsComponent,
        UnitStatsSubordinateUnitsComponent,
        UnitStatsMembersSumComponent,
        UnitStatsMembersAgeComponent,
        UnitStatsMembersCategoryComponent,
        UnitListPageComponent,
        UnitListViewComponent,
        UnitSearchModalComponent,
        UnitLandingComponent
    ],
    providers: [
        WebApiUnitMembersService,
        UnitService,
        DisappearingScrollActionBarComponent,
        ScrollTopBarListComponent,
        InfoLineComponent,
        SortModalComponent,
        EventListItemHeaderComponent,
    ],
    schemas: [
        NO_ERRORS_SCHEMA
    ]
})
export class UnitModule {
}
