]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - client/src/app/shared/shared-main/buttons/edit-button.component.ts
Auto update publishedAt in live restream
[github/Chocobozzz/PeerTube.git] / client / src / app / shared / shared-main / buttons / edit-button.component.ts
1 import { Component, Input, OnInit } from '@angular/core'
2
3 @Component({
4 selector: 'my-edit-button',
5 styleUrls: [ './button.component.scss' ],
6 templateUrl: './edit-button.component.html'
7 })
8 export class EditButtonComponent implements OnInit {
9 @Input() label: string
10 @Input() title: string
11 @Input() routerLink: string[] | string = []
12 @Input() responsiveLabel = false
13
14 ngOnInit () {
15 // <my-edit-button /> No label
16 if (this.label === undefined && !this.title) {
17 this.title = $localize`Update`
18 }
19
20 // <my-edit-button label /> Use default label
21 if (this.label === '') {
22 this.label = $localize`Update`
23
24 if (!this.title) {
25 this.title = this.label
26 }
27 }
28 }
29 }