import { Component, OnInit,ViewChild, Input } from '@angular/core';
import { GROUP_BY } from '../../../plugin/utils/dashboard-plugin-util';
import { getAssetImgUrl }  from '../../shared/hostUrl';

@Component({
  selector: 'summary-graph',
  templateUrl: './summary.component.html',
  styleUrls: ['./summary.component.css']
})
export class SummaryComponent implements OnInit {

    compType:any;
    
    @Input() todaysCallInfo:any;
    @Input('elWidth') elWidth:any;
    private _total:number =0;
    @ViewChild('exPanel') exPanel:any;
    planCount:any;
    ASSET_IMG_URL:any;
    
  constructor() {}
    
  ngOnInit() {
      console.log("for grpah info ===== > ", this.todaysCallInfo);
      this.ASSET_IMG_URL = getAssetImgUrl();
      
      if(this.todaysCallInfo.data && this.todaysCallInfo.data.VISIT_SUMMARY)
      {
          this.todaysCallInfo.data.VISIT_SUMMARY.forEach(
                  (visit:any) => {
                      if(visit.OPTION_NAME == 'Unlisted'){
                          this.planCount = visit.OPTION_VALUE;
                      }
                  }
          );
      }
  }
  
  ngOnChanges() {
      console.log('ngOnChanges in SummaryComponent',this.elWidth );
  }

}
