import energyEfficiencyComponent from "./../../../components/energy-efficiency.hbs";

export function displayEnergyEfficiency(dataEnergy) {
  if (!dataEnergy) {
    return '';
  }

  const energyImagesLinks = dataEnergy.labels.map(item => item.url);
  const ratingType = dataEnergy.oldRatingType ? 'Old' : 'New';

  return energyEfficiencyComponent({
    type: ratingType,
    images: energyImagesLinks,
    rating: dataEnergy.ratingValue,
    linkProduct: dataEnergy.productInformationSheet?.url,
    modificator: "energy-efficiency--basket",
  })
}
