import { ChangeDetectionStrategy, Component, inject } from '@angular/core';
import { ARCHIVE_ROUTE, DOSSIER_TEMPLATE_ID, DOSSIERS_ROUTE } from '@red/domain';
import { DashboardStatsService } from '@services/dossier-templates/dashboard-stats.service';
import { getParam } from '@iqser/common-ui/lib/utils';

@Component({
    selector: 'redaction-dossiers-type-switch',
    templateUrl: './dossiers-type-switch.component.html',
    styleUrls: ['./dossiers-type-switch.component.scss'],
    changeDetection: ChangeDetectionStrategy.OnPush,
})
export class DossiersTypeSwitchComponent {
    readonly DOSSIERS_ROUTE = DOSSIERS_ROUTE;
    readonly ARCHIVE_ROUTE = ARCHIVE_ROUTE;
    readonly dossierTemplate$ = inject(DashboardStatsService).getEntityChanged$(getParam(DOSSIER_TEMPLATE_ID));
}
