import { Component, Input } from '@angular/core';
import { NgClass, NgForOf, NgStyle } from '@angular/common';

export interface ValueColumn {
    label: string;
    show: boolean;
    bold?: boolean;
}

const TABLE_ROW_SIZE = 18;
const MAX_ITEMS_DISPLAY = 10;

@Component({
    selector: 'redaction-selected-annotations-table',
    standalone: true,
    imports: [NgForOf, NgClass, NgStyle],
    templateUrl: './selected-annotations-table.component.html',
    styleUrl: './selected-annotations-table.component.scss',
})
export class SelectedAnnotationsTableComponent {
    @Input({ required: true }) columns: ValueColumn[];
    @Input({ required: true }) data: ValueColumn[][];
    @Input() staticColumns = false;

    get redactedTextsAreaHeight() {
        return this.data.length <= MAX_ITEMS_DISPLAY ? TABLE_ROW_SIZE * this.data.length : TABLE_ROW_SIZE * MAX_ITEMS_DISPLAY;
    }
}
