import { Component } from '@angular/core';
import { DetailsTitleBase } from '@components/title-base/details-title-base';
import { TranslatePipe } from '@ngx-translate/core';
import { ScheduleUrlBuilderService } from '@schedule/services/url/url-builder.service';

@Component({
    selector: 'schedule-flight-details-title',
    templateUrl: './schedule-flight-details-title.component.html',
})
export class ScheduleFlightDetailsTitleComponent extends DetailsTitleBase {
    constructor(
        protected translatePipe: TranslatePipe,
        protected urlService: ScheduleUrlBuilderService,
    ) {
        super(translatePipe, urlService);
    }

    protected get titleKey() {
        return 'SHARED.SCHEDULE-FLIGHT';
    }

    protected get pluralTitleKey() {
        return 'SCHEDULE.SCHEDULE-FLIGHTS';
    }

    protected translateTitle(): string {
        return `${this.base}: ${this.flightInfo}, ${this.departure} - ${this.arrival}`;
    }

    protected translatePluralTitle() {
        return `${this.base}: ${this.flightInfo}`;
    }
}
