diff --git a/src/app/components/plan/PlanPart.tsx b/src/app/components/plan/PlanPart.tsx index 4890e42..75f5f76 100644 --- a/src/app/components/plan/PlanPart.tsx +++ b/src/app/components/plan/PlanPart.tsx @@ -22,7 +22,7 @@ export default function PlanPart({ { label: "option 2", value: "option 2" }, { label: "option 3", value: "option 3" }, { label: "option 4", value: "option 4" }, - { label: "option 5", value: "option 5" }, + { label: "option5", value: "option 5" }, ]; const [selectedOption, setSelectedOption] = useState(options[0].value); @@ -37,7 +37,7 @@ export default function PlanPart({
Cost: {cost}
+Cost: £{cost}
CO2 Emissions: {co2Emissions}
diff --git a/src/app/portfolio/[slug]/property/[lmkKey]/plan/page.tsx b/src/app/portfolio/[slug]/property/[lmkKey]/plan/page.tsx index 9d1adf9..89eb386 100644 --- a/src/app/portfolio/[slug]/property/[lmkKey]/plan/page.tsx +++ b/src/app/portfolio/[slug]/property/[lmkKey]/plan/page.tsx @@ -1,12 +1,13 @@ "use client"; -import { SearchData } from "@/types/epc"; +import { EpcRating, SearchData } from "@/types/epc"; import { useQuery } from "@tanstack/react-query"; import { useRouter } from "next/navigation"; import { fetchData } from "../utils"; import { useState } from "react"; import { PencilSquareIcon } from "@heroicons/react/24/outline"; import PlanPart from "@/app/components/plan/PlanPart"; +import EditEpctargetModal from "@/app/components/property/EditEpcTargetModal"; export default function Plan({ params, @@ -20,12 +21,8 @@ export default function Plan({ const portfolioId = params.slug; const lmkKey = params.lmkKey; const postcode = searchParams.postcode; - const targetEpcRating = searchParams.targetEpcRating ?? "C"; - - const [budget, setBudget] = useState("Not set"); - const [totalCost, setTotalCost] = useState("Not set"); - const [installTime, setInstallTime] = useState("Not set"); + // Temp config for the demo const partsConfig = [ { part: "Roof", cost: 1000, co2Emissions: 50, workHours: 20 }, { part: "Walls", cost: 1000, co2Emissions: 50, workHours: 20 }, @@ -57,6 +54,19 @@ export default function Plan({ }, ]; + const totalWorkHours = partsConfig.reduce( + (sum, part) => sum + part.workHours, + 0 + ); + + const [budget, setBudget] = useState("Not set"); + const [totalCost, setTotalCost] = useState("Not set"); + const [installTime, setInstallTime] = useState(totalWorkHours); + const [isEditModalOpen, setIsEditModalOpen] = useState(false); + const [targetEpcRating, setTargetEpcRating] = useState