import { Component, Input } from '@angular/core';
import { DashboardStats } from '@red/domain';
import { IconButtonTypes } from '@iqser/common-ui';
import { TranslateChartService } from '@services/translate-chart.service';
import { SharedDialogService } from '@shared/services/dialog.service';
import { Roles } from '@users/roles';
import { PermissionsService } from '@services/permissions.service';

@Component({
    selector: 'redaction-template-stats [stats]',
    templateUrl: './template-stats.component.html',
    styleUrls: ['./template-stats.component.scss'],
})
export class TemplateStatsComponent {
    readonly iconButtonTypes = IconButtonTypes;
    readonly roles = Roles;

    @Input() stats: DashboardStats;

    constructor(
        private readonly _dialogService: SharedDialogService,
        readonly translateChartService: TranslateChartService,
        readonly permissionsService: PermissionsService,
    ) {}

    newDossier(): void {
        this._dialogService.openDialog('addDossier', { dossierTemplateId: this.stats.dossierTemplateId });
    }
}
