import { Component, ChangeDetectionStrategy, Input } from '@angular/core';
import { KpiFeed } from '@domain/isa';

@Component({
  selector: 'page-kpi-card',
  templateUrl: 'kpi-card.component.html',
  styleUrls: ['kpi-card.component.scss'],
  changeDetection: ChangeDetectionStrategy.OnPush,
})
export class KpiCardComponent {
  @Input()
  feed: KpiFeed;

  constructor() {}

  percentage(current: number, target: number) {
    return Math.round((current / target) * 100);
  }
}
