import { Component, OnInit, Input } from '@angular/core';

@Component({
  selector: 'lib-progress-bar',
  templateUrl: './progress-bar.component.html',
  styleUrls: ['./progress-bar.component.scss'],
})
export class ProgressBarComponent implements OnInit {
  @Input() color = '#83ae77';
  @Input() backgroundColor = '#cfd4d8';
  @Input() progress = 0;
  constructor() {}

  ngOnInit() {}

  currentProgress() {
    try {
      return this.progress === 0 ? 0 : Math.round(this.progress * 100);
    } catch {
      return this.progress;
    }
  }
}
