]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - client/src/app/shared/shared-main/buttons/button.component.ts
Refactor button components
[github/Chocobozzz/PeerTube.git] / client / src / app / shared / shared-main / buttons / button.component.ts
CommitLineData
74d63469 1import { Component, Input } from '@angular/core'
67ed6552 2import { GlobalIconName } from '@app/shared/shared-icons'
74d63469
GR
3
4@Component({
5 selector: 'my-button',
faf7eab7 6 styleUrls: [ './button.component.scss' ],
74d63469
GR
7 templateUrl: './button.component.html'
8})
9
10export class ButtonComponent {
11 @Input() label = ''
b345a804 12 @Input() className = 'grey-button'
457bb213 13 @Input() icon: GlobalIconName = undefined
db66f391 14 @Input() routerLink: string[] | string
c199c427 15 @Input() title: string = undefined
b5f919ac 16 @Input() loading = false
1fe1e14c 17 @Input() disabled = false
faf7eab7 18 @Input() responsiveLabel = false
74d63469 19
1fe1e14c
RK
20 getClasses () {
21 return {
22 [this.className]: true,
faf7eab7 23 disabled: this.disabled,
db129781 24 'icon-only': !this.label,
db66f391 25 'has-icon': !!this.icon,
faf7eab7 26 'responsive-label': this.responsiveLabel
1fe1e14c
RK
27 }
28 }
74d63469 29}