From f03883738aacd2001851efd954b8937cfb6f355e Mon Sep 17 00:00:00 2001 From: Khalim Conn-Kowlessar Date: Wed, 31 May 2023 18:12:52 +0100 Subject: [PATCH] Implemented functionality on plan page --- src/app/components/plan/PartDropdown.tsx | 13 +- src/app/components/plan/PartModal.tsx | 41 ++++-- src/app/components/plan/PlanPart.tsx | 56 ++++++--- .../[slug]/property/[lmkKey]/plan/page.tsx | 119 ++++++++++++++---- 4 files changed, 169 insertions(+), 60 deletions(-) diff --git a/src/app/components/plan/PartDropdown.tsx b/src/app/components/plan/PartDropdown.tsx index 35e9e32f..1a9ca63c 100644 --- a/src/app/components/plan/PartDropdown.tsx +++ b/src/app/components/plan/PartDropdown.tsx @@ -1,16 +1,11 @@ import { Fragment } from "react"; import { Menu, Transition } from "@headlessui/react"; import { ChevronDownIcon } from "@heroicons/react/20/solid"; - -type Option = { - label: string; - value: string; - cost: number; -}; +import { PartOption } from "@/types/parts"; type DropdownProps = { - options: Option[]; - onSelectOption: (option: Option) => void; + options: PartOption[]; + onSelectOption: (option: PartOption) => void; selectedOption: string; }; @@ -39,7 +34,7 @@ export default function PartDropdown({ > {options.map((option) => ( - + {({ active }) => (