diff --git a/src/app/portfolio/[slug]/building-passport/[propertyId]/utils.ts b/src/app/portfolio/[slug]/building-passport/[propertyId]/utils.ts index 931affe..b1f7078 100644 --- a/src/app/portfolio/[slug]/building-passport/[propertyId]/utils.ts +++ b/src/app/portfolio/[slug]/building-passport/[propertyId]/utils.ts @@ -1,5 +1,6 @@ import { db } from "@/app/db/db"; import { + GeneralFeature, PropertyDetailsEpc, PropertyMeta, propertyDetailsEpc, @@ -40,13 +41,13 @@ export async function getConditionReport( export function formatGeneralFeatures( conditionReportData: PropertyDetailsEpc, propertyType: string -) { +): GeneralFeature[] { // if a property is a flat/maisonette, we show heat loss coridoor information, otherwise we won't show it const flatOnlyFeatures = [ { feature: "Heat loss corridor", - description: Boolean(conditionReportData.heatLossCorridor) ? "Yes" : "No", + description: conditionReportData.heatLossCorridor ? "Yes" : "No", }, { feature: "Heat loss corridor length", @@ -59,7 +60,7 @@ export function formatGeneralFeatures( }, ]; - const generealFeatures = [ + const generealFeatures: GeneralFeature[] = [ { feature: "Floor Height", description: conditionReportData.floorHeight || "unknown", @@ -78,11 +79,11 @@ export function formatGeneralFeatures( }, { feature: "Mains gas", - description: conditionReportData.mainsGas || "unknown", + description: conditionReportData.mainsGas ? "Yes" : "No", }, { feature: "Energy tariff", - description: conditionReportData.energyTariff, + description: conditionReportData.energyTariff || "unknown", }, ...(propertyType === "Flat" || propertyType === "Maisonette" ? flatOnlyFeatures