import { ChangeDetectionStrategy, Component, input } from '@angular/core';
import { TranslatePipe } from '../../../../i18n/translate.pipe';

export interface ContentHealthItem {
  labelKey: string;
  done: boolean;
}

/**
 * Reusable checklist + completion meter. Fed real per-item booleans and a
 * precomputed percentage by the caller - never invents its own data.
 */
@Component({
  selector: 'app-content-health-widget',
  standalone: true,
  imports: [TranslatePipe],
  templateUrl: './content-health-widget.component.html',
  styleUrl: './content-health-widget.component.scss',
  changeDetection: ChangeDetectionStrategy.OnPush,
})
export class ContentHealthWidgetComponent {
  readonly titleKey = input.required<string>();
  readonly items = input.required<ContentHealthItem[]>();
  readonly completionPercent = input.required<number>();
}
