import { Component, Input } from '@angular/core';
import { getConfig } from '@iqser/common-ui';
import { Dossier, File, IFileAttributeConfig } from '@red/domain';
import { FileAttributesService } from '@services/entity-services/file-attributes.service';
import { FileNameColumnComponent } from '@shared/components/file-name-column/file-name-column.component';
import { DateColumnComponent } from '../../../shared-dossiers/components/date-column/date-column.component';
import { FileAttributeComponent } from '../file-attribute/file-attribute.component';
import { NgForOf, NgIf } from '@angular/common';
import { AnnotationIconComponent } from '@shared/components/annotation-icon/annotation-icon.component';
import { FileWorkloadComponent } from './file-workload/file-workload.component';
import { InitialsAvatarComponent, IqserUsersModule } from '@common-ui/users';
import { MatIcon } from '@angular/material/icon';
import { OcrProgressBarComponent } from '@shared/components/ocr-progress-bar/ocr-progress-bar.component';
import { ProcessingIndicatorComponent } from '@shared/components/processing-indicator/processing-indicator.component';
import { StatusBarComponent } from '@common-ui/shared';
import { FileActionsComponent } from '../../../shared-dossiers/components/file-actions/file-actions.component';
import { TranslateModule } from '@ngx-translate/core';

@Component({
    selector: 'redaction-table-item',
    templateUrl: './table-item.component.html',
    styleUrls: ['./table-item.component.scss'],
    standalone: true,
    imports: [
        FileNameColumnComponent,
        DateColumnComponent,
        FileAttributeComponent,
        NgIf,
        AnnotationIconComponent,
        FileWorkloadComponent,
        IqserUsersModule,
        MatIcon,
        OcrProgressBarComponent,
        ProcessingIndicatorComponent,
        StatusBarComponent,
        FileActionsComponent,
        TranslateModule,
        NgForOf,
        InitialsAvatarComponent,
    ],
})
export class TableItemComponent {
    @Input({ required: true }) file: File;
    @Input({ required: true }) dossier: Dossier;
    @Input({ required: true }) displayedAttributes: IFileAttributeConfig[];
    @Input({ required: true }) dossierTemplateId: string;

    readonly isDocumine = getConfig().IS_DOCUMINE;

    constructor(readonly fileAttributesService: FileAttributesService) {}
}
