mirror of
https://github.com/Hestia-Homes/assessment-model.git
synced 2026-06-08 11:37:25 +00:00
implemented epc update functionality
This commit is contained in:
parent
30962b20cf
commit
9e8f548eb4
3 changed files with 11 additions and 3 deletions
|
|
@ -15,21 +15,23 @@ export default function RecommendationCard({
|
|||
recommendationData,
|
||||
setCostMap,
|
||||
costMap,
|
||||
totalEstimatedCost,
|
||||
setTotalEstimatedCost,
|
||||
sapMap,
|
||||
setSapMap,
|
||||
setTotalSapPoints,
|
||||
currentSapPoints,
|
||||
setExpectedEpcRating,
|
||||
}: {
|
||||
componentType: string;
|
||||
recommendationData: ComponentRecommendation[];
|
||||
setCostMap: Dispatch<SetStateAction<RecommendationMetricMap>>;
|
||||
costMap: RecommendationMetricMap;
|
||||
totalEstimatedCost: number;
|
||||
setTotalEstimatedCost: Dispatch<SetStateAction<number>>;
|
||||
sapMap: RecommendationMetricMap;
|
||||
setSapMap: Dispatch<SetStateAction<RecommendationMetricMap>>;
|
||||
setTotalSapPoints: Dispatch<SetStateAction<number>>;
|
||||
currentSapPoints: number;
|
||||
setExpectedEpcRating: Dispatch<SetStateAction<string>>;
|
||||
}) {
|
||||
const defaultComponent = recommendationData.find(
|
||||
(rec: ComponentRecommendation) => rec.default
|
||||
|
|
@ -99,6 +101,8 @@ export default function RecommendationCard({
|
|||
sapMap={sapMap}
|
||||
setSapMap={setSapMap}
|
||||
setTotalSapPoints={setTotalSapPoints}
|
||||
currentSapPoints={currentSapPoints}
|
||||
setExpectedEpcRating={setExpectedEpcRating}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ export default async function Recommendations() {
|
|||
estimatedCost: 9_450,
|
||||
default: true,
|
||||
newUValue: 0.29,
|
||||
sapPoints: 11,
|
||||
sapPoints: 4,
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
|
|
|
|||
|
|
@ -36,6 +36,10 @@ export function formatDateTime(dateTimeString: string): string {
|
|||
}
|
||||
|
||||
export function formatNumber(number: number): string {
|
||||
if (number === 0) {
|
||||
return "0";
|
||||
}
|
||||
|
||||
const suffixes: string[] = ["", "k", "m", "b", "t"];
|
||||
const suffixIndex: number = Math.floor(Math.log10(Math.abs(number)) / 3);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue