hh-ui-components
Version:
18 lines • 1.14 kB
JavaScript
import React, { useState } from "react";
// import { Wishlists } from "@helpers/WishlistHelper";
import HeartIcon from "../../icons/HeartIcon";
/* A way to import a component dynamically. */
var Wishlist = function (_a) {
var className = _a.className, id = _a.id, variant = _a.variant, productInfo = _a.productInfo, insights = _a.insights;
// const { wishlist, setWishlist } = useGlobalContext();
var _b = useState(false), wishlisted = _b[0], setWishlisted = _b[1];
// useEffect(() => {
// setWishlisted(Wishlists(id, wishlist, "wishlisted"));
// }, [wishlist, id]);
return (React.createElement("div", null,
React.createElement("div", { className: className },
React.createElement("button", { "aria-label": "Add to wishlist", className: "flex items-center justify-center p-[3px]" },
React.createElement(HeartIcon, { className: "".concat(wishlisted ? "fill-black" : "lg:hover:fill-black", " h-[1.5rem] w-[1.5rem] cursor-pointer lg:h-[1.5rem] lg:w-[1.5rem] 2xl:w-[1.667vw] 2xl:h-[1.667vw]") })))));
};
export default Wishlist;
//# sourceMappingURL=Wishlist.js.map