1 import { Component, Input, ViewChild } from '@angular/core'
2 import { MarkdownService } from '@app/core'
3 import { VideoDetails } from '@app/shared/shared-main'
4 import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
5 import { VideoChannel } from '@shared/models'
8 selector: 'my-support-modal',
9 templateUrl: './support-modal.component.html'
11 export class SupportModalComponent {
12 @Input() video: VideoDetails = null
13 @Input() videoChannel: VideoChannel = null
15 @ViewChild('modal', { static: true }) modal: NgbModal
21 private markdownService: MarkdownService,
22 private modalService: NgbModal
26 const modalRef = this.modalService.open(this.modal, { centered: true })
28 const support = this.video?.support || this.videoChannel.support
30 this.markdownService.enhancedMarkdownToHTML({ markdown: support })
35 this.displayName = this.video
36 ? this.video.channel.displayName
37 : this.videoChannel.displayName