1 import { Input, Component, Output, EventEmitter, OnInit } from '@angular/core'
2 import { RouterLink } from '@angular/router'
3 import { I18n } from '@ngx-translate/i18n-polyfill'
4 import { ListKeyManagerOption } from '@angular/cdk/a11y'
8 type: 'channel' | 'suggestion' | 'search-channel' | 'search-instance' | 'search-global' | 'search-any'
9 routerLink?: RouterLink
13 selector: 'my-suggestion',
14 templateUrl: './suggestion.component.html',
15 styleUrls: [ './suggestion.component.scss' ]
17 export class SuggestionComponent implements OnInit, ListKeyManagerOption {
18 @Input() result: Result
19 @Input() highlight: string
20 @Output() selected = new EventEmitter()
23 inThisChannelText: string
24 inThisInstanceText: string
32 this.inAllText = this.i18n('In the vidiverse')
33 this.inThisChannelText = this.i18n('In this channel')
34 this.inThisInstanceText = this.i18n('In this instance')
38 return this.result.text
46 this.selected.emit(this.result)