From 3a1f88876eb457d48183b5028b147004519b06eb Mon Sep 17 00:00:00 2001 From: Khalim Conn-Kowlessar Date: Fri, 16 Feb 2024 17:18:23 +0000 Subject: [PATCH] Adding reference to adjusted heat demand to front end --- .../RecommendationContainer.tsx | 42 ++++++++++--------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/src/app/components/building-passport/RecommendationContainer.tsx b/src/app/components/building-passport/RecommendationContainer.tsx index 95f6a5eb..5fa166ca 100644 --- a/src/app/components/building-passport/RecommendationContainer.tsx +++ b/src/app/components/building-passport/RecommendationContainer.tsx @@ -42,7 +42,7 @@ const emptyImpactState = { labourDays: 0, co2EquivalentSavings: 0, energyCostSavings: 0, - heatDemand: 0, + adjustedHeatDemand: 0, }; export default function RecommendationContainer({ @@ -102,19 +102,19 @@ export default function RecommendationContainer({ ) || emptyImpactState; const [costMap, setCostMap] = useState({ - wall_insulation: defaultWallsRecommendations?.estimatedCost || 0, - floor_insulation: defaultFloorRecommendations?.estimatedCost || 0, - roof_insulation: defaultRoofRecommendations?.estimatedCost || 0, + wall_insulation: defaultWallsRecommendations.estimatedCost || 0, + floor_insulation: defaultFloorRecommendations.estimatedCost || 0, + roof_insulation: defaultRoofRecommendations.estimatedCost || 0, mechanical_ventilation: - defaultVentiliationRecommendations?.estimatedCost || 0, - sealing_open_fireplace: defaultFireplaceRecommendations?.estimatedCost || 0, - low_energy_lighting: defaultLightingRecommendations?.estimatedCost || 0, - windows_glazing: defaultWindowsRecommendations?.estimatedCost || 0, - solar_pv: defaultSolarRecommendations?.estimatedCost || 0, + defaultVentiliationRecommendations.estimatedCost || 0, + sealing_open_fireplace: defaultFireplaceRecommendations.estimatedCost || 0, + low_energy_lighting: defaultLightingRecommendations.estimatedCost || 0, + windows_glazing: defaultWindowsRecommendations.estimatedCost || 0, + solar_pv: defaultSolarRecommendations.estimatedCost || 0, }); const [sapMap, setSapMap] = useState({ - wall_insulation: defaultWallsRecommendations?.sapPoints || 0, + wall_insulation: defaultWallsRecommendations.sapPoints || 0, floor_insulation: defaultFloorRecommendations.sapPoints || 0, roof_insulation: defaultRoofRecommendations.sapPoints || 0, mechanical_ventilation: defaultVentiliationRecommendations.sapPoints || 0, @@ -125,7 +125,7 @@ export default function RecommendationContainer({ }); const [labourDaysMap, setLabourDaysMap] = useState({ - wall_insulation: defaultWallsRecommendations?.labourDays || 0, + wall_insulation: defaultWallsRecommendations.labourDays || 0, floor_insulation: defaultFloorRecommendations.labourDays || 0, roof_insulation: defaultRoofRecommendations.labourDays || 0, mechanical_ventilation: defaultVentiliationRecommendations.labourDays || 0, @@ -136,7 +136,7 @@ export default function RecommendationContainer({ }); const [co2SavingsMap, setCo2SavingsMap] = useState({ - wall_insulation: defaultWallsRecommendations?.co2EquivalentSavings || 0, + wall_insulation: defaultWallsRecommendations.co2EquivalentSavings || 0, floor_insulation: defaultFloorRecommendations.co2EquivalentSavings || 0, roof_insulation: defaultRoofRecommendations.co2EquivalentSavings || 0, mechanical_ventilation: @@ -165,14 +165,16 @@ export default function RecommendationContainer({ }); const [heatDemandMap, setHeatDemandMap] = useState({ - wall_insulation: defaultWallsRecommendations?.heatDemand || 0, - floor_insulation: defaultFloorRecommendations.heatDemand || 0, - roof_insulation: defaultRoofRecommendations.heatDemand || 0, - mechanical_ventilation: defaultVentiliationRecommendations.heatDemand || 0, - sealing_open_fireplace: defaultFireplaceRecommendations.heatDemand || 0, - low_energy_lighting: defaultLightingRecommendations.heatDemand || 0, - windows_glazing: defaultWindowsRecommendations.heatDemand || 0, - solar_pv: defaultSolarRecommendations.heatDemand || 0, + wall_insulation: defaultWallsRecommendations.adjustedHeatDemand || 0, + floor_insulation: defaultFloorRecommendations.adjustedHeatDemand || 0, + roof_insulation: defaultRoofRecommendations.adjustedHeatDemand || 0, + mechanical_ventilation: + defaultVentiliationRecommendations.adjustedHeatDemand || 0, + sealing_open_fireplace: + defaultFireplaceRecommendations.adjustedHeatDemand || 0, + low_energy_lighting: defaultLightingRecommendations.adjustedHeatDemand || 0, + windows_glazing: defaultWindowsRecommendations.adjustedHeatDemand || 0, + solar_pv: defaultSolarRecommendations.adjustedHeatDemand || 0, }); const [totalEstimatedCost, setTotalEstimatedCost] = useState(