1 import { ListKeyManagerOption } from '@angular/cdk/a11y'
2 import { Component, Input, OnInit } from '@angular/core'
3 import { RouterLink } from '@angular/router'
5 export type SuggestionPayload = {
7 type: SuggestionPayloadType
8 routerLink?: RouterLink
12 export type SuggestionPayloadType = 'search-instance' | 'search-index'
15 selector: 'my-suggestion',
16 templateUrl: './suggestion.component.html',
17 styleUrls: [ './suggestion.component.scss' ]
19 export class SuggestionComponent implements OnInit, ListKeyManagerOption {
20 @Input() result: SuggestionPayload
21 @Input() highlight: string
27 return this.result.text
31 if (this.result.default) this.active = true