aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/shared-main/account/avatar.component.ts
blob: 2967828a05396a404a3aec1f68905070e5c190a1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import { Component, Input, OnInit } from '@angular/core'
import { Video } from '../video/video.model'

@Component({
  selector: 'avatar-channel',
  templateUrl: './avatar.component.html',
  styleUrls: [ './avatar.component.scss' ]
})
export class AvatarComponent implements OnInit {
  @Input() video: Video
  @Input() size: 'md' | 'sm' = 'md'
  @Input() genericChannel: boolean

  channelLinkTitle = ''
  accountLinkTitle = ''

  ngOnInit () {
    this.channelLinkTitle = $localize`${this.video.account.name} (channel page)`
    this.accountLinkTitle = $localize`${this.video.byAccount} (account page)`
  }

  isChannelAvatarNull () {
    return this.video.channel.avatar === null
  }
}