diff --git a/src/app/components/building-passport/RecommendationCard.tsx b/src/app/components/building-passport/RecommendationCard.tsx index f4a9ff8..4053353 100644 --- a/src/app/components/building-passport/RecommendationCard.tsx +++ b/src/app/components/building-passport/RecommendationCard.tsx @@ -18,6 +18,7 @@ const TitleMap = { floor_insulation: "Floor Insulation", roof_insulation: "Roof Insulation", mechanical_ventilation: "Mechanical Ventilation", + sealing_open_fireplace: "Sealing Open Fireplace", }; export default function RecommendationCard({ diff --git a/src/app/components/building-passport/RecommendationContainer.tsx b/src/app/components/building-passport/RecommendationContainer.tsx index 9cfd74c..672785c 100644 --- a/src/app/components/building-passport/RecommendationContainer.tsx +++ b/src/app/components/building-passport/RecommendationContainer.tsx @@ -53,12 +53,18 @@ export default function RecommendationContainer({ (rec: Recommendation) => rec.default ) || { estimatedCost: 0, sapPoints: 0 }; + const defaultFireplaceRecommendations = + categorizedRecommendations.sealing_open_fireplace?.find( + (rec: Recommendation) => rec.default + ) || { estimatedCost: 0, sapPoints: 0 }; + const [costMap, setCostMap] = useState({ 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, }); const [sapMap, setSapMap] = useState({ @@ -66,6 +72,7 @@ export default function RecommendationContainer({ floor_insulation: defaultFloorRecommendations.sapPoints || 0, roof_insulation: defaultRoofRecommendations.sapPoints || 0, mechanical_ventilation: defaultVentiliationRecommendations.sapPoints || 0, + sealing_open_fireplace: defaultFireplaceRecommendations.sapPoints || 0, }); const [totalEstimatedCost, setTotalEstimatedCost] = useState( diff --git a/src/app/db/schema/recommendations.ts b/src/app/db/schema/recommendations.ts index 34765ac..bbf0ed7 100644 --- a/src/app/db/schema/recommendations.ts +++ b/src/app/db/schema/recommendations.ts @@ -148,7 +148,8 @@ export type RecommendationType = | "wall_insulation" | "floor_insulation" | "roof_insulation" - | "mechanical_ventilation"; + | "mechanical_ventilation" + | "sealing_open_fireplace"; export type UnnestedRecommendation = { quantity: number; diff --git a/src/app/portfolio/[slug]/building-passport/[propertyId]/plans/page.tsx b/src/app/portfolio/[slug]/building-passport/[propertyId]/plans/page.tsx index 8f3c8a9..5c40507 100644 --- a/src/app/portfolio/[slug]/building-passport/[propertyId]/plans/page.tsx +++ b/src/app/portfolio/[slug]/building-passport/[propertyId]/plans/page.tsx @@ -96,7 +96,7 @@ export default async function RecommendationPlans({ const expectedEpcRating = sapToEpc(expectedSapPoints); return ( -
+