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

@Component({
  selector: 'app-event-progress',
  templateUrl: './event-progress.component.html',
  styleUrls: ['./event-progress.component.css']
})
export class EventProgressComponent implements OnInit {

  @Input() Events:any;
  @Input() status:string;
  @Input() eventName:string;


  constructor() { }

  ngOnInit() {


  }
  getTrim(text){
    if(text){
      return text.substring(6);
    }
  }
  callClass(Status){

    //console.log(Status,'statusssssssssssssss',this.eventName);

    if(this.eventName === 'business'){
      if(Status == 'TA_REJECTED' || Status == 'TA_APPROVED' || Status == 'ONBOARDED'|| Status == 'METTL_APPROVED' ||
        Status == 'METTL_SCHEDULED' || Status == 'METTL_COACH_ASSIGNED' || Status == 'METTL_REVIEW' || Status == 'COACH_ASSIGNED'  ||
        Status =='MINI_PG_STARTED' || Status =='COURSE_COMPLETED' || Status == 'MINI_PG_COMPLETED' || Status == 'MINI_PG_COACH_APPROVED'  || Status =='MINI_PG_COACH_REJECTED'){


        return 'notStarted';
      }
      else if(Status =='MAIN_PG_COACH_ASSIGNED'|| Status =='MAIN_PG_STARTED'){


        return 'Active';
      }

      else if(Status =='MAIN_PG_COMPELTED' || Status =='MAIN_PG_COMPLETED'){


        return 'coachEvaluation';
      }

      else if(Status =='MAIN_PG_COACH_REVIEWED'|| Status =='MAIN_PG_MANAGER_REJECTED' || Status =='MAIN_PG_MANAGER_APPROVED'){


        return 'completed';
      }

    }
    else if(this.eventName === 'technical'){

      if(Status == 'TA_REJECTED' || Status == 'TA_APPROVED' || Status == 'METTL_COACH_ASSIGNED' || Status == 'ONBOARDED'||Status == 'METTL_APPROVED' || Status == 'METTL_SCHEDULED' || Status == 'METTL_REVIEW'  ){


        return 'notStarted';
      }

      else if(Status == 'COACH_ASSIGNED'  || Status =='MINI_PG_STARTED' ){


        return 'Active';
      }

      else if(Status == 'MINI_PG_COMPLETED'    ){


        return 'coachEvaluation';
      }
     else if(Status == 'MINI_PG_COACH_APPROVED'  || Status =='MINI_PG_COACH_REJECTED' ||Status =='MAIN_PG_COACH_ASSIGNED'|| Status =='MAIN_PG_STARTED' ||Status =='MAIN_PG_COMPELTED' || Status =='MAIN_PG_COMPLETED' || Status =='MAIN_PG_COACH_REVIEWED'|| Status =='MAIN_PG_MANAGER_REJECTED' || Status =='MAIN_PG_MANAGER_APPROVED'){


        return 'completed';
      }

    }
    else if(this.eventName === 'primary'){

      if( Status == 'TA_REJECTED' || Status == 'ONBOARDED' ){


        return 'notStarted';
      }

      else if(Status == 'METTL_COACH_ASSIGNED' ){


        return 'Active';
      }
      else if(Status == 'TA_APPROVED' || Status == 'COURSE_COMPLETED' ){


        return 'yetTo';
      }
      else if(Status == 'METTL_SCHEDULED' ){


        return 'Active';
      }

      else if(Status == 'METTL_REVIEW'  ){


        return 'coachEvaluation';
      }
      else {


        return 'completed';
      }

    }
  }
}
