aboutsummaryrefslogblamecommitdiffhomepage
path: root/client/src/app/shared/shared-main/buttons/delete-button.component.ts
blob: 0ee7d3757451fe463849fd1c5518fe000bdbecf0 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
                                                        


                               
             




                                                           
   
  
                                                      
                        
                        
                                  
                            
 
               
                                                  
                                    



                                                   
                                    
     
   
 
import { Component, Input, OnInit } from '@angular/core'

@Component({
  selector: 'my-delete-button',
  template: `
    <my-button
      icon="delete" className="grey-button"
      [disabled]="disabled" [label]="label" [title]="title"
      [responsiveLabel]="responsiveLabel"
    ></my-button>
  `
})
export class DeleteButtonComponent implements OnInit {
  @Input() label: string
  @Input() title: string
  @Input() responsiveLabel = false
  @Input() disabled: boolean

  ngOnInit () {
    if (this.label === undefined && !this.title) {
      this.title = $localize`Delete`
    }

    // <my-delete-button label /> Use default label
    if (this.label === '') {
      this.label = $localize`Delete`
    }
  }
}