import { Pipe, PipeTransform } from '@angular/core'; // helpers import { LastFuelPriceProgressHelper } from '../../ca-last-fuel-price-progress/utils/helpers'; @Pipe({ name: 'fuelPricesRange', }) export class FuelPricesRangePipe implements PipeTransform { transform(lastFuelPriceData: { minValue: number; maxValue: number; totalValue: number; isOutdated?: boolean; isCardVariation?: boolean; }): { svgPosition: number; svgClass: string } { const { minValue, maxValue, totalValue, isOutdated, isCardVariation } = lastFuelPriceData; return LastFuelPriceProgressHelper.calculateSvgPosition( minValue, maxValue, totalValue, isOutdated, !isCardVariation, isCardVariation ); } }