diff --git a/src/app/(car-listings)/SectionGridHasMap.tsx b/src/app/(car-listings)/SectionGridHasMap.tsx new file mode 100644 index 0000000..5908844 --- /dev/null +++ b/src/app/(car-listings)/SectionGridHasMap.tsx @@ -0,0 +1,112 @@ +"use client"; + +import React, { FC, useState } from "react"; +import GoogleMapReact from "google-map-react"; +import { DEMO_CAR_LISTINGS } from "@/data/listings"; +import ButtonClose from "@/shared/ButtonClose"; +import Checkbox from "@/shared/Checkbox"; +import Pagination from "@/shared/Pagination"; +import TabFilters from "./TabFilters"; +import Heading2 from "@/shared/Heading2"; +import CarCardH from "@/components/CarCardH"; +import AnyReactComponent from "@/components/AnyReactComponent/AnyReactComponent"; + +const DEMO_CARS = DEMO_CAR_LISTINGS.filter((_, i) => i < 12); + +export interface SectionGridHasMapProps {} + +const SectionGridHasMap: FC = () => { + const [currentHoverID, setCurrentHoverID] = useState(-1); + const [showFullMapFixed, setShowFullMapFixed] = useState(false); + + return ( +
+
+ {/* CARDSSSS */} +
+ + 233 cars + ยท + Aug 12 - 18 + + } + /> +
+ +
+
+ {DEMO_CARS.map((item) => ( +
setCurrentHoverID((_) => item.id)} + onMouseLeave={() => setCurrentHoverID((_) => -1)} + > + +
+ ))} +
+
+ +
+
+ +
setShowFullMapFixed(true)} + > + + Show map +
+ + {/* MAPPPPP */} +
+ {showFullMapFixed && ( + setShowFullMapFixed(false)} + className="bg-white absolute z-50 left-3 top-3 shadow-lg rounded-xl w-10 h-10" + /> + )} + +
+
+ +
+ {/* BELLOW IS MY GOOGLE API KEY -- PLEASE DELETE AND TYPE YOUR API KEY */} + + + {DEMO_CARS.map((item) => ( + + ))} + +
+
+
+
+ ); +}; + +export default SectionGridHasMap;