import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
import { environment } from '../../../../environments/environment.dev';
@Component({
  selector: 'app-candidate-challenge',
  templateUrl: './candidate-challenge.component.html',
  styleUrls: ['./candidate-challenge.component.scss']
})
export class CandidateChallengeComponent implements OnInit {
  @Input() taskStatus: string;
  @Input() statusColor: string;
  @Input() notApplicable: boolean;
  @Input() boxBorderColor: string;
  @Input() challengeDetails: any;
  @Input() linkDetails: any;
  @Input() challengeName: string;
  @Input() userStatus: string;
  @Input() statusText: string;
  @Input() statusTextColor: string;
  @Input() dashboardDetails;
  @Output() getEventStatusDetails = new EventEmitter();
  @Output() viewDetails = new EventEmitter();
  @Output() checkSuccess = new EventEmitter();
  img_link: string;
  constructor() {
    this.img_link = environment.imageUrl + '/assets/img/candidate/dashboard/';
  }

  ngOnInit() {
     //console.log("dashboard content/data --- ",this.dashboardDetails)
  }
  getEventStatus(event) {
    if (this.challengeName === 'Primary Challenge') {
      const obj = {
        id: 1,
        event: event
      };
      this.getEventStatusDetails.emit(obj);
    } else if (this.challengeName === 'Coding Challenge') {
      const obj = {
        id: 2,
        event: event
      };
      this.getEventStatusDetails.emit(obj);
    } else if (this.challengeName === 'Whiteboard Discussion') {
      const obj = {
        id: 3,
        event: event
      };
      this.getEventStatusDetails.emit(obj);
    } else if (this.challengeName === 'Leadership Connect') {
      const obj = {
        id: 4,
        event: event
      };
      this.getEventStatusDetails.emit(obj);
    }
  }
  viewCoadingDetails() {
    this.viewDetails.emit();
  }
  checkForSuccess() {
    this.checkSuccess.emit();
  }
}
