implemented estimation notification in the front end

This commit is contained in:
Khalim Conn-Kowlessar 2024-01-04 14:18:43 +00:00
parent 6be23db727
commit 33aebe5b97
4 changed files with 13 additions and 3 deletions

View file

@ -36,6 +36,7 @@ export async function GET(
columns: {
adjustedEnergyConsumption: true,
co2Emissions: true,
estimated: true,
},
},
},

View file

@ -35,6 +35,7 @@ export interface PropertyMeta {
detailsEpc: {
adjustedEnergyConsumption: number | null;
co2Emissions: number | null;
estimated: boolean;
};
}

View file

@ -1,6 +1,16 @@
import { Toolbar } from "@/app/components/building-passport/Toolbar";
import { getPropertyMeta } from "./utils";
import BackToPortfolioButton from "@/app/components/building-passport/BackToPortfolioButton";
import { ExclamationCircleIcon } from "@heroicons/react/24/outline";
function EstimatedDataNotification() {
return (
<div className="flex items-center text-brandmidblue mt-4">
<ExclamationCircleIcon className="h-5 w-5 mr-2" />
<div>Data for this property has been estimated based on nearby homes</div>
</div>
);
}
export default async function DashboardLayout({
children, // will be a page or nested layout
@ -39,6 +49,7 @@ export default async function DashboardLayout({
<div className="col-span-12 justify-center bg-gray-50 py-2 rounded-md">
<Toolbar propertyId={propertyId} portfolioId={portfolioId} />
</div>
{propertyMeta.detailsEpc.estimated && <EstimatedDataNotification />}
{children}
</div>
</section>

View file

@ -47,9 +47,6 @@ function PropertyDetailsCard({
.filter(Boolean)
.join(" ");
console.log("KJHEKJLWFWEL");
console.log(propertyDetailsSpatial);
return (
<div className="w-full flex flex-col items-center p-4 shadow rounded-md justify-start bg-gray-100">
<div className="grid grid-cols-2 gap-8 text-m w-full h-full text-sm">