X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2Fheader%2Fsuggestion.component.ts;h=c874212a5a9ea51556307014bcb186c7a62c8c6b;hb=900f7820814b95b07ef0bcac04036a95abfbe060;hp=69641b511b9612f55c40fe3155bb980f301b2808;hpb=2ad9dcda240ee843c5e4a5b98cc94f7b2aab2c89;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/app/header/suggestion.component.ts b/client/src/app/header/suggestion.component.ts index 69641b511..c874212a5 100644 --- a/client/src/app/header/suggestion.component.ts +++ b/client/src/app/header/suggestion.component.ts @@ -1,24 +1,24 @@ -import { Input, Component, Output, EventEmitter, OnInit, ChangeDetectionStrategy } from '@angular/core' -import { RouterLink } from '@angular/router' import { ListKeyManagerOption } from '@angular/cdk/a11y' +import { Component, Input, OnInit } from '@angular/core' +import { RouterLink } from '@angular/router' -export type Result = { +export type SuggestionPayload = { text: string - type: 'channel' | 'suggestion' | 'search-channel' | 'search-instance' | 'search-global' | 'search-any' - routerLink?: RouterLink, - default?: boolean + type: SuggestionPayloadType + routerLink?: RouterLink + default: boolean } +export type SuggestionPayloadType = 'search-instance' | 'search-index' + @Component({ selector: 'my-suggestion', templateUrl: './suggestion.component.html', - styleUrls: [ './suggestion.component.scss' ], - changeDetection: ChangeDetectionStrategy.OnPush + styleUrls: [ './suggestion.component.scss' ] }) export class SuggestionComponent implements OnInit, ListKeyManagerOption { - @Input() result: Result + @Input() result: SuggestionPayload @Input() highlight: string - @Output() selected = new EventEmitter() disabled = false active = false @@ -30,8 +30,4 @@ export class SuggestionComponent implements OnInit, ListKeyManagerOption { ngOnInit () { if (this.result.default) this.active = true } - - selectItem () { - this.selected.emit(this.result) - } }