Reorganize client shared modules
[oweals/peertube.git] / client / src / app / shared / shared-main / account / avatar.component.ts
1 import { Component, Input, OnInit } from '@angular/core'
2 import { Video } from '../video/video.model'
3 import { I18n } from '@ngx-translate/i18n-polyfill'
4
5 @Component({
6   selector: 'avatar-channel',
7   templateUrl: './avatar.component.html',
8   styleUrls: [ './avatar.component.scss' ]
9 })
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(
23       '{{name}} (channel page)',
24       { name: this.video.channel.name, handle: this.video.byVideoChannel }
25     )
26     this.accountLinkTitle = this.i18n(
27       '{{name}} (account page)',
28       { name: this.video.account.name, handle: this.video.byAccount }
29     )
30   }
31 }