diff --git a/src/app/(client-components)/(HeroSearchForm)/(real-estate-search-form)/PriceRangeInput.tsx b/src/app/(client-components)/(HeroSearchForm)/(real-estate-search-form)/PriceRangeInput.tsx new file mode 100644 index 0000000..b96255f --- /dev/null +++ b/src/app/(client-components)/(HeroSearchForm)/(real-estate-search-form)/PriceRangeInput.tsx @@ -0,0 +1,137 @@ +"use client"; + +import React, { Fragment, useState, FC } from "react"; +import { Popover, Transition } from "@headlessui/react"; +import Slider from "rc-slider"; +import convertNumbThousand from "@/utils/convertNumbThousand"; +import ButtonSubmit from "../ButtonSubmit"; +import { CurrencyDollarIcon } from "@heroicons/react/24/outline"; + +export interface PriceRangeInputProps { + onChange?: (data: any) => void; + fieldClassName?: string; +} + +const PriceRangeInput: FC = ({ + onChange, + fieldClassName = "[ nc-hero-field-padding ]", +}) => { + const [rangePrices, setRangePrices] = useState([100000, 4000000]); + + return ( + + {({ open, close }) => ( + <> +
+ document.querySelector("html")?.click()} + > +
+ +
+
+ + {`$${convertNumbThousand( + rangePrices[0] / 1000 + )}k ~ $${convertNumbThousand(rangePrices[1] / 1000)}k`} + + + Choose price range + +
+
+ + {/* BUTTON SUBMIT OF FORM */} +
+ +
+
+ + {open && ( +
+ )} + + + +
+
+ Range Price + setRangePrices(e as number[])} + /> +
+ +
+
+ +
+
+ $ +
+ +
+
+
+ +
+
+ $ +
+ +
+
+
+
+
+
+ + )} +
+ ); +}; + +export default PriceRangeInput;