import { inject, NgModule } from '@angular/core';
import { LicenseScreenComponent } from './license-screen/license-screen.component';
import { LicenseSelectComponent } from './components/license-select/license-select.component';
import { RouterModule, Routes } from '@angular/router';
import { TranslateModule } from '@ngx-translate/core';
import { MatSelectModule } from '@angular/material/select';
import { IqserHelpModeModule, IqserListingModule, SizePipe } from '@iqser/common-ui';
import { FormsModule } from '@angular/forms';
import { CommonModule } from '@angular/common';
import { LicenseService } from '@services/license.service';
import { ChartComponent } from './components/chart/chart.component';
import { NgChartsModule } from 'ng2-charts';
import { LicenseRetentionCapacityComponent } from './components/license-retention-capacity-usage/license-retention-capacity.component';
import { DonutChartComponent } from '@shared/components/donut-chart/donut-chart.component';
import { LicensePageUsageComponent } from './components/license-page-usage/license-page-usage.component';
import { LicenseAnalysisCapacityUsageComponent } from './components/license-analysis-capacity-usage/license-analysis-capacity-usage.component';

const routes: Routes = [
    {
        path: '',
        component: LicenseScreenComponent,
        resolve: {
            licenseData: () => inject(LicenseService).loadLicenseData(),
        },
    },
];

@NgModule({
    declarations: [
        LicenseScreenComponent,
        LicenseSelectComponent,
        ChartComponent,
        LicenseRetentionCapacityComponent,
        LicensePageUsageComponent,
        LicenseAnalysisCapacityUsageComponent,
    ],
    imports: [
        RouterModule.forChild(routes),
        CommonModule,
        TranslateModule,
        MatSelectModule,
        FormsModule,
        IqserListingModule,
        IqserHelpModeModule,
        SizePipe,
        NgChartsModule,
        DonutChartComponent,
    ],
})
export class LicenseModule {}
