import { ChangeDetectionStrategy, Component, Input, OnChanges } from '@angular/core';
import { File } from '@red/domain';
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
import { MatTooltip } from '@angular/material/tooltip';
import { TranslateModule } from '@ngx-translate/core';
import { MatIcon } from '@angular/material/icon';
import { NgIf } from '@angular/common';

@Component({
    selector: 'redaction-processing-indicator [file]',
    templateUrl: './processing-indicator.component.html',
    styleUrls: ['./processing-indicator.component.scss'],
    changeDetection: ChangeDetectionStrategy.OnPush,
    standalone: true,
    imports: [MatTooltip, TranslateModule, MatIcon, NgIf],
})
export class ProcessingIndicatorComponent implements OnChanges {
    tooltip: string;
    @Input() file: File;

    ngOnChanges() {
        this.tooltip = this.file.isInitialProcessing ? _('file-status.initial-processing') : _('file-status.re-processing');
    }
}
