1 import { ChangeDetectionStrategy, Component, Input, OnChanges, OnInit } from '@angular/core'
2 import { GlobalIconName } from '@app/shared/shared-icons'
6 styleUrls: [ './button.component.scss' ],
7 templateUrl: './button.component.html',
8 changeDetection: ChangeDetectionStrategy.OnPush
11 export class ButtonComponent implements OnInit, OnChanges {
13 @Input() className = 'grey-button'
14 @Input() icon: GlobalIconName = undefined
15 @Input() routerLink: string[] | string
16 @Input() title: string = undefined
17 @Input() loading = false
18 @Input() disabled = false
19 @Input() responsiveLabel = false
21 classes: { [id: string]: boolean } = {}
31 private buildClasses () {
33 [this.className]: true,
34 'disabled': this.disabled,
35 'icon-only': !this.label,
36 'has-icon': !!this.icon,
37 'responsive-label': this.responsiveLabel