import { Component, Input, ViewEncapsulation } from '@angular/core';
import { ISearchHistoryItem } from '@shared/services/history/search-history.service';
import { IParsedFlightId } from '@typings/flight/flight-id';

@Component({
    selector: 'online-board-history-item',
    templateUrl: './online-board-history-item.component.html',
    encapsulation: ViewEncapsulation.None,
})
export class OnlineBoardHistoryItemComponent {
    @Input() item: ISearchHistoryItem;

    get isFlightNumberSearch(): boolean {
        const params = this.item.params as IParsedFlightId;

        return !!params.flightNumber;
    }
}
