split out epc summary card

This commit is contained in:
Khalim Conn-Kowlessar 2023-07-28 17:33:29 +01:00
parent a653e157e0
commit fbefb31dd5
2 changed files with 30 additions and 13 deletions

View file

@ -12,6 +12,7 @@ import { sapToEpc } from "@/app/utils";
import { useState } from "react";
import { sumRecommendationMetricMap } from "@/app/portfolio/[slug]/building-passport/[propertyId]/recommendations/utils";
import { RecommendationMetricMap } from "@/types/recommendations";
import RecommendationEpcSummaryCard from "./RecommendationEpcSummaryCard";
interface RecommendationContainerProps {
recommendations: Recommendation;
@ -70,19 +71,10 @@ export default function RecommendationContainer({
totalSapPoints={totalSapPoints}
/>
<table className="text-left bg-green-700 rounded-md text-gray-100">
<tbody>
<tr>
<td className="font-medium pl-4 py-2">Current EPC Rating:</td>
<td className="font-bold pr-2">{currentEpcRating}</td>
</tr>
<tr>
<td className="font-medium pl-4 py-2">Expected EPC Rating:</td>
<td className="font-bold pr-2">{expectedEpcRating}</td>
</tr>
</tbody>
</table>
<RecommendationEpcSummaryCard
currentEpcRating={currentEpcRating}
expectedEpcRating={expectedEpcRating}
/>
</div>
<Separator className="mb-4" />

View file

@ -0,0 +1,25 @@
interface RecommendationEpcSummaryCardProps {
currentEpcRating: string;
expectedEpcRating: string;
}
export default function RecommendationEpcSummaryCard({
currentEpcRating,
expectedEpcRating,
}: RecommendationEpcSummaryCardProps) {
return (
<table className="text-left bg-green-700 rounded-md text-gray-100">
<tbody>
<tr>
<td className="font-medium pl-4 py-2">Current EPC Rating:</td>
<td className="font-bold pr-2">{currentEpcRating}</td>
</tr>
<tr>
<td className="font-medium pl-4 py-2">Expected EPC Rating:</td>
<td className="font-bold pr-2">{expectedEpcRating}</td>
</tr>
</tbody>
</table>
);
}