import { Component, EventEmitter, Input, Output } from '@angular/core';
import { DossierAttributeConfig, IDossierAttributeConfig } from '@red/domain';
import { dossierAttributeTypesTranslations } from '@translations/dossier-attribute-types-translations';
import { MatTooltip } from '@angular/material/tooltip';
import { TranslateModule } from '@ngx-translate/core';
import { CircleButtonComponent } from '@iqser/common-ui';
import { NgIf } from '@angular/common';

@Component({
    selector: 'redaction-table-item [attribute] [canEditDossierAttributes]',
    templateUrl: './table-item.component.html',
    styleUrls: ['./table-item.component.scss'],
    standalone: true,
    imports: [MatTooltip, TranslateModule, CircleButtonComponent, NgIf],
})
export class TableItemComponent {
    readonly translations = dossierAttributeTypesTranslations;

    @Input() attribute: DossierAttributeConfig;
    @Input() canEditDossierAttributes: boolean;
    @Output() openAddEditAttributeDialog = new EventEmitter<IDossierAttributeConfig>();
    @Output() openConfirmDeleteAttributeDialog = new EventEmitter<DossierAttributeConfig[]>();
}
