diff --git a/src/app/components/plan/PartDropdown.tsx b/src/app/components/plan/PartDropdown.tsx
new file mode 100644
index 0000000..7cf8947
--- /dev/null
+++ b/src/app/components/plan/PartDropdown.tsx
@@ -0,0 +1,58 @@
+import { Fragment } from "react";
+import { Menu, Transition } from "@headlessui/react";
+import { ChevronDownIcon } from "@heroicons/react/20/solid";
+
+type Option = {
+ label: string;
+ value: string;
+};
+
+type DropdownProps = {
+ options: Option[];
+ onSelectOption: (option: Option) => void;
+ selectedOption: string;
+};
+
+export default function PartDropdown({
+ options,
+ onSelectOption,
+ selectedOption,
+}: DropdownProps) {
+ return (
+
+ );
+}
diff --git a/src/app/components/plan/PartModal.tsx b/src/app/components/plan/PartModal.tsx
new file mode 100644
index 0000000..ef940dc
--- /dev/null
+++ b/src/app/components/plan/PartModal.tsx
@@ -0,0 +1,96 @@
+import { Dialog, Transition } from "@headlessui/react";
+import { Dispatch, Fragment, SetStateAction, useState } from "react";
+import { TanButton } from "../Button";
+import PartDropdown from "./PartDropdown";
+
+export default function PartModal({
+ title,
+ isOpen,
+ setIsOpen,
+ options,
+ selectedOption,
+ setSelectedOption,
+}: {
+ title: string;
+ isOpen: boolean;
+ setIsOpen: Dispatch>;
+ options: { label: string; value: string }[];
+ selectedOption: string;
+ setSelectedOption: Dispatch>;
+}) {
+ function handleModalSubmit() {
+ // setTargetEpcRating(modalEpcTarget);
+ setIsOpen(false);
+ }
+
+ return (
+ <>
+
+
+
+ >
+ );
+}
diff --git a/src/app/components/plan/PlanPart.tsx b/src/app/components/plan/PlanPart.tsx
new file mode 100644
index 0000000..4890e42
--- /dev/null
+++ b/src/app/components/plan/PlanPart.tsx
@@ -0,0 +1,58 @@
+import { useState } from "react";
+import PartModal from "./PartModal";
+
+type PlanPartProps = {
+ title: string;
+ cost: number;
+ co2Emissions: number;
+ workHours: number;
+};
+
+export default function PlanPart({
+ title,
+ cost,
+ co2Emissions,
+ workHours,
+}: PlanPartProps) {
+ const [isOpen, setIsOpen] = useState(false);
+
+ // These are temporary options for the demo
+ const options = [
+ { label: "option 1", value: "option 1" },
+ { label: "option 2", value: "option 2" },
+ { label: "option 3", value: "option 3" },
+ { label: "option 4", value: "option 4" },
+ { label: "option 5", value: "option 5" },
+ ];
+
+ const [selectedOption, setSelectedOption] = useState(options[0].value);
+
+ return (
+ {
+ setIsOpen(true);
+ }}
+ className="active:bg-blue-700 focus:outline-none transition-colors duration-200 flex bg-white p-4 rounded-lg shadow mb-4 items-center border-l-4 border-l-brandmidblue hover:bg-brandmidblue hover:text-white hover:border-l-brandtan cursor-pointer"
+ >
+
{title}
+
{selectedOption}
+
+
+
CO2 Emissions: {co2Emissions}
+
+
+
Work Hours: {workHours}
+
+
+
+ );
+}
diff --git a/src/app/portfolio/[slug]/property/[lmkKey]/plan/page.tsx b/src/app/portfolio/[slug]/property/[lmkKey]/plan/page.tsx
index 1eedb9f..9d1adf9 100644
--- a/src/app/portfolio/[slug]/property/[lmkKey]/plan/page.tsx
+++ b/src/app/portfolio/[slug]/property/[lmkKey]/plan/page.tsx
@@ -5,40 +5,8 @@ import { useQuery } from "@tanstack/react-query";
import { useRouter } from "next/navigation";
import { fetchData } from "../utils";
import { useState } from "react";
-
-import React from "react";
import { PencilSquareIcon } from "@heroicons/react/24/outline";
-
-type PlanPartProps = {
- title: string;
- cost: number;
- co2Emissions: number;
- workHours: number;
-};
-
-const PlanPart: React.FC = ({
- title,
- cost,
- co2Emissions,
- workHours,
-}) => {
- return (
-
-
-
{title}
-
-
-
-
CO2 Emissions: {co2Emissions}
-
-
-
Work Hours: {workHours}
-
-
- );
-};
+import PlanPart from "@/app/components/plan/PlanPart";
export default function Plan({
params,
@@ -58,6 +26,37 @@ export default function Plan({
const [totalCost, setTotalCost] = useState("Not set");
const [installTime, setInstallTime] = useState("Not set");
+ const partsConfig = [
+ { part: "Roof", cost: 1000, co2Emissions: 50, workHours: 20 },
+ { part: "Walls", cost: 1000, co2Emissions: 50, workHours: 20 },
+ { part: "Floors", cost: 1000, co2Emissions: 50, workHours: 20 },
+ { part: "Window Glazing", cost: 1000, co2Emissions: 50, workHours: 20 },
+ {
+ part: "Window Draughproofing",
+ cost: 1000,
+ co2Emissions: 50,
+ workHours: 20,
+ },
+ { part: "Door Insulation", cost: 1000, co2Emissions: 50, workHours: 20 },
+ {
+ part: "Door Draughproofing",
+ cost: 1000,
+ co2Emissions: 50,
+ workHours: 20,
+ },
+ { part: "Heating", cost: 1000, co2Emissions: 50, workHours: 20 },
+ { part: "Hot Water", cost: 1000, co2Emissions: 50, workHours: 20 },
+ { part: "Solar Panels", cost: 1000, co2Emissions: 50, workHours: 20 },
+ { part: "Solar Hot Water", cost: 1000, co2Emissions: 50, workHours: 20 },
+ { part: "Lighting", cost: 1000, co2Emissions: 50, workHours: 20 },
+ {
+ part: "Chimneys/ Open Fire Places",
+ cost: 1000,
+ co2Emissions: 50,
+ workHours: 20,
+ },
+ ];
+
if (postcode === undefined) {
router.push(`/portfolio/${portfolioId}/error`);
}
@@ -79,25 +78,24 @@ export default function Plan({
const propertyData = data.rows.filter((row) => row["lmk-key"] === lmkKey)[0];
return (
-
+
Your Retrofit Plan
{propertyData.address}
- {/* Clickable Cards */}
- {/* Replace this with your actual clickable cards */}
-
-
- Clickable Card 2
-
- {/* Add more clickable cards as needed */}
+ {partsConfig.map((part, index) => {
+ return (
+
+ );
+ })}