]>
Commit | Line | Data |
---|---|---|
c2caa99b RK |
1 | import { Component, Input, OnInit } from '@angular/core' |
2 | import { Video } from '../video/video.model' | |
3 | import { I18n } from '@ngx-translate/i18n-polyfill' | |
dd4f25ee RK |
4 | |
5 | @Component({ | |
6 | selector: 'avatar-channel', | |
7 | templateUrl: './avatar.component.html', | |
8 | styleUrls: [ './avatar.component.scss' ] | |
9 | }) | |
c2caa99b RK |
10 | export class AvatarComponent implements OnInit { |
11 | @Input() video: Video | |
12 | @Input() size: 'md' | 'sm' = 'md' | |
13 | ||
14 | channelLinkTitle = '' | |
15 | accountLinkTitle = '' | |
16 | ||
17 | constructor ( | |
18 | private i18n: I18n | |
19 | ) {} | |
20 | ||
21 | ngOnInit () { | |
22 | this.channelLinkTitle = this.i18n( | |
d6d951dd | 23 | '{{name}} (channel page)', |
c2caa99b RK |
24 | { name: this.video.channel.name, handle: this.video.byVideoChannel } |
25 | ) | |
26 | this.accountLinkTitle = this.i18n( | |
d6d951dd | 27 | '{{name}} (account page)', |
c2caa99b RK |
28 | { name: this.video.account.name, handle: this.video.byAccount } |
29 | ) | |
30 | } | |
dd4f25ee | 31 | } |