diff --git a/src/app/components/building-passport/RecommendationCard.tsx b/src/app/components/building-passport/RecommendationCard.tsx index 40533535..f43f7a0b 100644 --- a/src/app/components/building-passport/RecommendationCard.tsx +++ b/src/app/components/building-passport/RecommendationCard.tsx @@ -19,6 +19,7 @@ const TitleMap = { roof_insulation: "Roof Insulation", mechanical_ventilation: "Mechanical Ventilation", sealing_open_fireplace: "Sealing Open Fireplace", + low_energy_lighting: "Low Energy Lighting", }; export default function RecommendationCard({ diff --git a/src/app/components/building-passport/RecommendationContainer.tsx b/src/app/components/building-passport/RecommendationContainer.tsx index b66894bf..775b6a1e 100644 --- a/src/app/components/building-passport/RecommendationContainer.tsx +++ b/src/app/components/building-passport/RecommendationContainer.tsx @@ -58,6 +58,11 @@ export default function RecommendationContainer({ (rec: Recommendation) => rec.default ) || { estimatedCost: 0, sapPoints: 0 }; + const defaultLightingRecommendations = + categorizedRecommendations.low_energy_lighting?.find( + (rec: Recommendation) => rec.default + ) || { estimatedCost: 0, sapPoints: 0 }; + const [costMap, setCostMap] = useState({ wall_insulation: defaultWallsRecommendations?.estimatedCost || 0, floor_insulation: defaultFloorRecommendations?.estimatedCost || 0, @@ -65,6 +70,7 @@ export default function RecommendationContainer({ mechanical_ventilation: defaultVentiliationRecommendations?.estimatedCost || 0, sealing_open_fireplace: defaultFireplaceRecommendations?.estimatedCost || 0, + low_energy_lighting: defaultLightingRecommendations?.estimatedCost || 0, }); const [sapMap, setSapMap] = useState({ @@ -73,6 +79,7 @@ export default function RecommendationContainer({ roof_insulation: defaultRoofRecommendations.sapPoints || 0, mechanical_ventilation: defaultVentiliationRecommendations.sapPoints || 0, sealing_open_fireplace: defaultFireplaceRecommendations.sapPoints || 0, + low_energy_lighting: defaultLightingRecommendations.sapPoints || 0, }); const [totalEstimatedCost, setTotalEstimatedCost] = useState( diff --git a/src/app/db/schema/recommendations.ts b/src/app/db/schema/recommendations.ts index 6c498d2a..8486ba47 100644 --- a/src/app/db/schema/recommendations.ts +++ b/src/app/db/schema/recommendations.ts @@ -100,7 +100,8 @@ export type RecommendationType = | "floor_insulation" | "roof_insulation" | "mechanical_ventilation" - | "sealing_open_fireplace"; + | "sealing_open_fireplace" + | "low_energy_lighting"; export type UnnestedRecommendation = { quantity: number; diff --git a/src/types/recommendations.ts b/src/types/recommendations.ts index bcfa940b..a5f49c6d 100644 --- a/src/types/recommendations.ts +++ b/src/types/recommendations.ts @@ -4,4 +4,5 @@ export interface RecommendationMetricMap { roof_insulation: number; mechanical_ventilation: number; sealing_open_fireplace: number; + low_energy_lighting: number; }