import { Component, Input, OnInit } from '@angular/core'; import { TypeSafeFormBuilder, TypeSafeFormGroup } from '@yourcause/common'; import { AnalyticsService, EventType } from '@yourcause/common/analytics'; import { YCModalComponent } from '@yourcause/common/modals'; import { ToggleHoldStatusModalResponse } from '../address-requests.typing'; @Component({ selector: 'gc-toggle-hold-status-modal', templateUrl: './toggle-hold-status-modal.component.html', styleUrls: ['./toggle-hold-status-modal.component.scss'] }) export class ToggleHoldStatusModalComponent extends YCModalComponent implements OnInit { @Input() releaseHold = false; @Input() orgName: string; @Input() applicantName: string; formGroup: TypeSafeFormGroup; constructor ( private formBuilder: TypeSafeFormBuilder, private analyticsService: AnalyticsService ) { super(); } ngOnInit () { this.formGroup = this.formBuilder.group({ comment: '' }); } handlePrimaryClick () { this.closeModal.emit(this.formGroup.value); this.analyticsService.emitEvent({ eventName: 'Toggle hold status', eventType: EventType.Click, extras: null }); } }