import { Component, Input, OnChanges } from '@angular/core'; import { ClientSettingsService } from '@features/client-settings/client-settings.service'; import { InKindRequestedItem } from '@features/in-kind/in-kind.typing'; @Component({ selector: 'gc-amount-currency-display', templateUrl: './amount-currency-display.component.html', styleUrls: ['./amount-currency-display.component.scss'] }) export class AmountCurrencyDisplayComponent implements OnChanges { @Input() applicationId: number; @Input() showInDefault: boolean; @Input() amount: string|number; @Input() inKindItems: InKindRequestedItem[]; @Input() inKindItemTotalCount: number; @Input() showItemPopover = false; @Input() popoverPlacement: 'right'|'left' = 'left'; @Input() equivalent: number; @Input() currencyRequested: string; @Input() isPayment: boolean; @Input() isUnits: boolean; @Input() amountIsBold = false; @Input() unitsOnNewLine = false; @Input() alignRight = false; defaultCurrency = this.clientSettingsService.defaultCurrency; constructor ( private clientSettingsService: ClientSettingsService ) { } ngOnChanges () { if (!this.currencyRequested) { this.currencyRequested = this.defaultCurrency; } } }