diff --git a/src/components/ProjectSelect.tsx b/src/components/ProjectSelect.tsx new file mode 100644 index 0000000..b0f26b4 --- /dev/null +++ b/src/components/ProjectSelect.tsx @@ -0,0 +1,47 @@ +/* eslint-disable react-hooks/exhaustive-deps */ +import clsx from "clsx"; +import { useEffect, useState } from "react"; + +interface Project { + title: string; + img: string; +} + +function ProjectSelect({ + projects, + onSelect, +}: { + projects: Project[]; + onSelect: (project: Project) => void; +}) { + const [selectedProject, setSelectedProject] = useState(projects[0]); + + useEffect(() => { + onSelect(selectedProject); + }, [selectedProject]); + + return ( +
+ {projects.map((project) => ( +
setSelectedProject(project)} + > + {project.title} +

{project.title}

+
+ ))} +
+ ); +} + +export default ProjectSelect; diff --git a/src/components/UnitTypeCard.tsx b/src/components/UnitTypeCard.tsx new file mode 100644 index 0000000..daf2053 --- /dev/null +++ b/src/components/UnitTypeCard.tsx @@ -0,0 +1,21 @@ +interface UnitType { + name: string; + img: string; + wings: string; + floors: string; + area: string; +} + +function UnitTypeCard({ project, type }: { project: string; type: UnitType }) { + return ( +
+

{project}

+

{type.name}

+

{type.wings}

+

{type.floors}

+

{type.area}

+
+ ); +} + +export default UnitTypeCard; diff --git a/src/data/projects.ts b/src/data/projects.ts index 87c64f4..995a505 100644 --- a/src/data/projects.ts +++ b/src/data/projects.ts @@ -2,9 +2,32 @@ export const projects = [ { title: "Rove Home Marasi Drive", img: "/images/search/rove_home_marasi_drive.png", + types: [ + { + name: "Studio Flex", + img: "", + wings: "West Wing", + floors: "Floor 5-21", + area: "341-366 Sqft", + }, + { + name: "Studio²", + img: "", + wings: "East Wing / West Wing", + floors: "Floor 5-21 / 24-31", + area: "386-416 Sqft", + }, + ], }, { title: "Rove Home Dubai Marina", img: "/images/search/rove_home_dubai_marina.png", + types: [ + { + name: "Studio Flex", + img: "", + wings: "West Wing", + }, + ], }, ]; diff --git a/src/layout/DefaultLayout.tsx b/src/layout/DefaultLayout.tsx index f6aa544..06211fe 100644 --- a/src/layout/DefaultLayout.tsx +++ b/src/layout/DefaultLayout.tsx @@ -4,9 +4,9 @@ import Footer from "../components/Footer"; function DefaultLayout() { return ( -
+
-
+