diff --git a/src/components/AnyReactComponent/AnyReactComponent.tsx b/src/components/AnyReactComponent/AnyReactComponent.tsx new file mode 100644 index 0000000..f03eb1a --- /dev/null +++ b/src/components/AnyReactComponent/AnyReactComponent.tsx @@ -0,0 +1,74 @@ +"use client"; + +import { Transition } from "@headlessui/react"; +import CarCard from "@/components/CarCard"; +import ExperiencesCard from "@/components/ExperiencesCard"; +import StayCard from "@/components/StayCard"; +import { CarDataType, ExperiencesDataType, StayDataType } from "@/data/types"; +import React, { FC, Fragment } from "react"; +import { useState } from "react"; + +export interface AnyReactComponentProps { + className?: string; + listing?: StayDataType; + experiences?: ExperiencesDataType; + car?: CarDataType; + isSelected?: boolean; + lat: number; + lng: number; +} + +const AnyReactComponent: FC = ({ + className = "", + listing, + car, + experiences, + isSelected, +}) => { + const [isOpen, setIsOpen] = useState(false); + + return ( +
setIsOpen(true)} + onMouseLeave={() => setIsOpen(false)} + > + + {listing?.price || experiences?.price || car?.price} + + +
+ {listing && ( + + )} + {experiences && ( + + )} + {car && } +
+
+
+ ); +}; + +export default AnyReactComponent;