import { Component, Input } from '@angular/core';
import { Leg } from '@app/shared/models-legacy';
import { arrivalBlockOnTimes, departureBlockOffCaption, departureBlockOffTimes, arrivalBlockOnCaption } from '@app/utils/times';

@Component({
    selector: 'flight-details-row-time',
    templateUrl: './flight-details-row-time.component.html',
    styleUrls: ['./flight-details-row-time.component.scss', './flight-details-row-time.component.mobile.scss'],
})
export class FlightDetailsRowTimeComponent {
    @Input() leg: Leg;

    get departureBlockOffTimes() {
        return departureBlockOffTimes(this.leg.departure._times);
    }

    get departureBlockOffCaption() {
        return departureBlockOffCaption(this.leg.departure._times);
    }

    get arrivalBlockOnTimes() {
        return arrivalBlockOnTimes(this.leg.arrival._times);
    }

    get arrivalBlockOnCaption() {
        return arrivalBlockOnCaption(this.leg.arrival._times);
    }
}
