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,
14 selector: 'my-suggestion',
15 templateUrl: './suggestion.component.html',
16 styleUrls: [ './suggestion.component.scss' ]
18 export class SuggestionComponent implements OnInit, ListKeyManagerOption {
19 @Input() result: Result
20 @Input() highlight: string
21 @Output() selected = new EventEmitter()
24 inThisChannelText: string
25 inThisInstanceText: string
33 this.inAllText = this.i18n('In the vidiverse')
34 this.inThisChannelText = this.i18n('In this channel')
35 this.inThisInstanceText = this.i18n('In this instance')
39 return this.result.text
43 if (this.result.default) this.active = true
47 this.selected.emit(this.result)