]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame_incremental - client/src/app/header/suggestion.component.ts
Translated using Weblate (Spanish)
[github/Chocobozzz/PeerTube.git] / client / src / app / header / suggestion.component.ts
... / ...
CommitLineData
1import { ListKeyManagerOption } from '@angular/cdk/a11y'
2import { Component, Input, OnInit } from '@angular/core'
3import { RouterLink } from '@angular/router'
4
5export type SuggestionPayload = {
6 text: string
7 type: SuggestionPayloadType
8 routerLink?: RouterLink
9 default: boolean
10}
11
12export type SuggestionPayloadType = 'search-instance' | 'search-index'
13
14@Component({
15 selector: 'my-suggestion',
16 templateUrl: './suggestion.component.html',
17 styleUrls: [ './suggestion.component.scss' ]
18})
19export class SuggestionComponent implements OnInit, ListKeyManagerOption {
20 @Input() result: SuggestionPayload
21 @Input() highlight: string
22
23 disabled = false
24 active = false
25
26 getLabel () {
27 return this.result.text
28 }
29
30 ngOnInit () {
31 if (this.result.default) this.active = true
32 }
33}