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


@Component({
  selector: 'app-sac-card',
  templateUrl: 'card.simple.component.html',
  styleUrls: ['card.simple.component.css'],
})

export class CardComponent {

  @Input() cardImage: string;
  @Input() title: string;
  @Input() bodyText: string;
  @Input() origin: string;
  @Input() originUrl: string;
  @Input() tempRating: number;

  @Output() headerClick = new EventEmitter();
  @Output() readMoreClick = new EventEmitter();


  getProgressLabel(value: number): string {
    if (value < 0.1) {
      return '<10%';
    } else {
      return `${this.getProgressValue(value)}%`;
    }
  }

  getProgressValue(value: number): string {
    if (value < 0.1) {
      return '10';
    } else {
      return (value * 100).toFixed(0);
    }
  }

  getProgressType(value: number): string {
    if (value > 0.75) {
      return 'success';
    } else if (value > 0.5) {
      return 'info';
    } else if (value > 0.1) {
      return 'warning';
    } else {
      return 'default';
    }
  }

  headerClicked() {
    this.headerClick.emit();
  }

  readMoreClicked() {
    this.readMoreClick.emit();
  }

  getFirstWords(str: string, number: number) {
    return str.split(/\W/, number).join(' ');
  }

}

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


@Component({
  selector: 'app-sac-card',
  templateUrl: 'card.simple.component.html',
  styleUrls: ['card.simple.component.css'],
})

export class CardComponent {

  @Input() cardImage: string;
  @Input() title: string;
  @Input() bodyText: string;
  @Input() origin: string;
  @Input() originUrl: string;
  @Input() tempRating: number;

  @Output() headerClick = new EventEmitter();
  @Output() readMoreClick = new EventEmitter();


  getProgressLabel(value: number): string {
    if (value < 0.1) {
      return '<10%';
    } else {
      return `${this.getProgressValue(value)}%`;
    }
  }

  getProgressValue(value: number): string {
    if (value < 0.1) {
      return '10';
    } else {
      return (value * 100).toFixed(0);
    }
  }

  headerClicked() {
    this.headerClick.emit();
  }

  readMoreClicked() {
    this.readMoreClick.emit();
  }

  getFirstWords(str: string, number: number) {
    return str.split(/\W/, number).join(' ');
  }

  private getProgressType(value: number): string {
    if (value > 0.75) {
      return 'success';
    } else if (value > 0.5) {
      return 'info';
    } else if (value > 0.1) {
      return 'warning';
    } else {
      return 'default';
    }
  }
}

Revert "build error fixed introduced with 59c064e"
Revert "build error fixed introduced with 59c064e"

This reverts commit ea741f69cf7bd9dcdc81aa0ed923acff8d4589d9.
