import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; import {VectorStep} from '@creedinteractive/onguard-models'; @Component({ selector: 'onguard-vector-step', templateUrl: './vector-step.component.html', styleUrls: ['./vector-step.component.scss'], }) export class VectorStepComponent implements OnInit { @Input() vectorStep: VectorStep; @Output() gotoLinkedVectorEvent = new EventEmitter(); iconSrc: string; constructor() {} ngOnInit(): void { this.iconSrc = `./assets/images/vector-step-icons/${this.determineIcon()}.svg`; } gotoLinkedVector() { this.gotoLinkedVectorEvent.emit(this.vectorStep.linkedVector) } private determineIcon(): string { switch (this.vectorStep.type) { case 'wait-time': return 'hourglass'; case 'route-to': return 'route'; case 'goto-step': return 'down-arrow'; case 'goto-vector': return 'right-arrow'; case 'stop': return 'stop'; case 'messaging': return 'message'; case 'queue-to': return 'busy'; // double-check case 'collect': return 'check'; case 'disconnect': return 'hang-up'; } } }