import { CommonModule } from '@angular/common'; import { Component, EventEmitter, Input, Output } from '@angular/core'; import { Button } from 'primeng/button'; import { Tooltip } from 'primeng/tooltip'; @Component({ selector: '[table-action-row]', standalone: true, imports: [CommonModule, Button, Tooltip], templateUrl: './table-action-row.component.html', }) export class TableActionRowComponent { @Input() showEdit = false; @Input() showDelete = false; @Input() showDetails = false; @Input() showDetailsText: string = 'جزییات'; @Output() edit = new EventEmitter(); @Output() delete = new EventEmitter(); @Output() details = new EventEmitter(); get widthStyle(): string { const count = [this.showEdit, this.showDelete, this.showDetails].filter(Boolean).length; return `${count * 2.5 + count - 1 * 0.25}rem`; } widthClass: string = ''; }