import { Component } from '@angular/core';
import { getConfig, IqserListingModule, IqserPermissionsService, SizePipe } from '@iqser/common-ui';
import { getCurrentUser } from '@iqser/common-ui/lib/users';
import type { AppConfig, User } from '@red/domain';
import { LicenseService } from '@services/license.service';
import { RouterHistoryService } from '@services/router-history.service';
import { Roles } from '@users/roles';
import { TranslateModule } from '@ngx-translate/core';
import { AsyncPipe, NgIf } from '@angular/common';
import { LicenseSelectComponent } from '../components/license-select/license-select.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';
import { LicenseRetentionCapacityComponent } from '../components/license-retention-capacity-usage/license-retention-capacity.component';
import { DatePipe } from '@shared/pipes/date.pipe';

@Component({
    templateUrl: './license-screen.component.html',
    styleUrls: ['./license-screen.component.scss'],
    standalone: true,
    imports: [
        IqserListingModule,
        TranslateModule,
        AsyncPipe,
        LicenseSelectComponent,
        NgIf,
        DatePipe,
        SizePipe,
        LicensePageUsageComponent,
        LicenseAnalysisCapacityUsageComponent,
        LicenseRetentionCapacityComponent,
    ],
})
export default class LicenseScreenComponent {
    protected readonly config = getConfig<AppConfig>();
    protected readonly roles = Roles;
    protected readonly currentUser = getCurrentUser<User>();
    protected readonly currentYear = new Date().getFullYear();

    constructor(
        readonly licenseService: LicenseService,
        readonly permissionsService: IqserPermissionsService,
        readonly routerHistoryService: RouterHistoryService,
    ) {}
}
