hh-ui-components
Version:
14 lines • 1.74 kB
JavaScript
import React, { useState } from "react";
import Size from "./Size";
var QuickBuy = function (_a) {
var parsed_sizes = _a.parsed_sizes, variants = _a.variants, tags = _a.tags, type = _a.type, _b = _a.isDisabled, isDisabled = _b === void 0 ? false : _b, productInfo = _a.productInfo, insights = _a.insights;
var _c = useState(Object), state = _c[0], setState = _c[1];
return (React.createElement("div", { className: "absolute bottom-[20px] left-[20px] right-[20px] hidden lg:group-hover:block 2xl:bottom-[1.389vw] 2xl:left-[1.389vw] 2xl:right-[1.389vw]" }, state.addToBag ? (React.createElement(React.Fragment, null,
React.createElement("div", { className: "hidden xl:block" },
React.createElement(Size, { sizes: parsed_sizes.sizes, setState: setState, variants: variants, tags: tags, isDisabled: type === "gift" && isDisabled, productInformation: productInfo, insights: insights })),
React.createElement("div", { className: "xl:hidden" },
React.createElement(Size, { sizes: parsed_sizes.sizes, setState: setState, variants: variants, tags: tags, isDisabled: type === "gift" && isDisabled, productInformation: productInfo, insights: insights })))) : (React.createElement("div", { onMouseOver: function () { return setState({ addToBag: true }); }, onMouseLeave: function () { return setState({ addToBag: false }); }, className: "w-full bg-tertiary rounded py-[5px] 2xl:py-[0.361vw] text-center cursor-pointer" },
React.createElement("button", { className: "rounded text-[14px] 2xl:text-[0.972vw] leading-[19.6px] 2xl:leading-[1.361vw] py-[10px] 2xl:py-[0.694vw]" }, type === "gift" ? "Claim Gift" : "Add to Bag")))));
};
export default QuickBuy;
//# sourceMappingURL=QuickBuy.js.map