import { Component, OnInit, ViewEncapsulation, Output, Input, EventEmitter } from '@angular/core';
import { environment } from '../../../../environments/environment.dev';
@Component({
  selector: 'app-employee-status',
  templateUrl: './employee-status.component.html',
  styleUrls: ['./employee-status.component.scss'],
  //encapsulation: ViewEncapsulation.None
})
export class EmployeeStatusComponent implements OnInit {
  imagelink: string;
  @Input() statuscount: any;
  @Output() statusfilter = new EventEmitter<any>();
  @Input() activefilter: any;
  constructor() { }

  ngOnInit() {
    this.imagelink = environment.imageUrl+'/assets/img/employee/newdashboard/';
  }

  getrecord(x) {
    this.statusfilter.emit(x);
  }

  getcolor(x) {
    const status = x;
    let color = '';
    switch (status) {
      case 'Overdue':
        color = '#F97787';
        return color;
      case 'To Do':
        color = '#68CBFF';
        return color;
      case 'In Progress':
        color = '#F8C580';
        return color;
      case 'Under Review':
        color = '#9B9B9B';
        return color;
      case 'Review Completed':
        color = '#8BC2AC';
        return color;
      case 'Done':
        color = '#15CC83';
        return color;
      default:
        color = '#ffffff';
        return color;
    }
  }
}
