diff --git a/src/app/components/property/partCard.tsx b/src/app/components/property/partCard.tsx
index 1ed4da7..d897055 100644
--- a/src/app/components/property/partCard.tsx
+++ b/src/app/components/property/partCard.tsx
@@ -1,17 +1,48 @@
-export default function PartCard({ title, handleDetailClick }) {
+import { Dialog } from "@headlessui/react";
+import { PencilSquareIcon } from "@heroicons/react/24/outline";
+import { useState } from "react";
+
+export default function PartCard({
+ title,
+ description,
+}: {
+ title: string;
+ description: string;
+}) {
+ const [isDetailModalOpen, setIsDetailModalOpen] = useState(false);
return (
-
-
-
{title}
-
+
+
+
+
{title}
+
+
+
{description}
- Short description of the card
-
+
+
);
}
diff --git a/src/app/portfolio/[slug]/property/[lmkKey]/page.tsx b/src/app/portfolio/[slug]/property/[lmkKey]/page.tsx
index ce4c384..92373a0 100644
--- a/src/app/portfolio/[slug]/property/[lmkKey]/page.tsx
+++ b/src/app/portfolio/[slug]/property/[lmkKey]/page.tsx
@@ -3,11 +3,12 @@
import { useState } from "react";
import { Dialog } from "@headlessui/react";
import Link from "next/link";
-import { ArrowLeftIcon } from "@heroicons/react/24/outline";
+import { ArrowLeftIcon, PencilSquareIcon } from "@heroicons/react/24/outline";
import { SearchData, EpcRating } from "@/types/epc";
import { useRouter } from "next/navigation";
import { useQuery } from "@tanstack/react-query";
import EditEpcTargetModal from "../../../../components/property/EditEpcTargetModal";
+import PartCard from "@/app/components/property/PartCard";
const EpcDefaults: { [key in EpcRating]: EpcRating } = {
G: "C",
@@ -19,6 +20,50 @@ const EpcDefaults: { [key in EpcRating]: EpcRating } = {
A: "A",
};
+const partConfig = [
+ {
+ title: "General",
+ descriptionData: [
+ { key: "built-form", prefix: "", suffix: "" },
+ { key: "property-type", prefix: "", suffix: "" },
+ ],
+ },
+ {
+ title: "Roof",
+ descriptionData: [{ key: "roof-description", prefix: "", suffix: "" }],
+ },
+ {
+ title: "Walls & Floors",
+ descriptionData: [
+ { key: "walls-description", prefix: "Walls: ", suffix: "" },
+ { key: "floor-description", prefix: "Floors: ", suffix: "" },
+ ],
+ },
+ {
+ title: "Windows & Doors",
+ descriptionData: [{ key: "windows-description", prefix: "", suffix: "" }],
+ },
+ {
+ title: "Heating",
+ descriptionData: [{ key: "mainheat-description", prefix: "", suffix: "" }],
+ },
+ {
+ title: "Renewables",
+ descriptionData: [
+ { key: "photo-supply", prefix: "", suffix: "" },
+ { key: "solar-water-heating-flag", prefix: "", suffix: "" },
+ ],
+ },
+ {
+ title: "Other",
+ descriptionData: [
+ { key: "lighting-description", prefix: "Lights: ", suffix: "" },
+ { key: "number-open-fireplaces", prefix: "", suffix: " open fireplaces" },
+ { key: "energy-tariff", prefix: "Energy tariff: ", suffix: "" },
+ ],
+ },
+];
+
async function fetchData(postcode: string): Promise
{
// TODO - add strict typing to the api response
@@ -50,7 +95,6 @@ export default function PropertyPage({
}
const [isEditModalOpen, setIsEditModalOpen] = useState(false);
- const [isDetailModalOpen, setIsDetailModalOpen] = useState(false);
const [targetEpcRating, setTargetEpcRating] = useState("");
const { data, error, isLoading } = useQuery({
@@ -78,9 +122,6 @@ export default function PropertyPage({
setIsEditModalOpen(true);
};
- const handleDetailClick = () => {
- setIsDetailModalOpen(true);
- };
// NextJS docs recomment fetching data directly in the component that needs it,
// even if requeting the same data in multiple components. rather than passing data between
// components as props
@@ -112,39 +153,35 @@ export default function PropertyPage({
Target EPC rating
Rating: {targetEpcRating}
-
+
-