const require_runtime = require("../../../../_virtual/_rolldown/runtime.js");
const require_useEngineContext = require("../../../../hooks/useEngineContext.js");
const require_mock = require("../../mock.js");
let react = require("react");
react = require_runtime.__toESM(react);
let _pisell_utils = require("@pisell/utils");
let _pisell_materials = require("@pisell/materials");
let classnames = require("classnames");
classnames = require_runtime.__toESM(classnames);
require("./index.less");
//#region src/components/eventBooking/components/productCard/index.tsx
const PisellProductCard = ({ item, showImage = true, showName = true, showPrice = true, showArrow = true, disabled = false, selected = false, className, style, onClick }) => {
	var _utils$storage;
	const utils = require_useEngineContext.default().appHelper.utils || {};
	const isEn = (utils === null || utils === void 0 || (_utils$storage = utils.storage) === null || _utils$storage === void 0 ? void 0 : _utils$storage.get("umi_locale")) === "en-US";
	const { product_card } = require_mock.mock;
	const { image, title, price, currency, isMultiPrice } = item || product_card;
	/**
	* @title: 显示单位
	* @description:
	* @param {*} useMemo
	* @return {*}
	* @Author: WangHan
	* @Date: 2025-01-23 10:21
	*/
	const fromText = (0, react.useMemo)(() => {
		if (!isMultiPrice) return "";
		return _pisell_utils.locales.getText("pisell2.event.price.from");
	}, [isMultiPrice]);
	return /* @__PURE__ */ react.default.createElement(_pisell_materials.PisellCard, {
		className: (0, classnames.default)("pisell-product-card", className),
		style,
		onClick,
		borderRadius: 8,
		disabled,
		selected
	}, /* @__PURE__ */ react.default.createElement("div", { className: "pisell-product-card-content" }, showImage && /* @__PURE__ */ react.default.createElement("div", { className: "pisell-product-card-image" }, image ? /* @__PURE__ */ react.default.createElement("img", { src: image }) : /* @__PURE__ */ react.default.createElement("div", { className: "image" })), /* @__PURE__ */ react.default.createElement("div", { className: "pisell-product-card-info" }, showName && /* @__PURE__ */ react.default.createElement("div", { className: "pisell-product-card-name" }, title), showPrice && /* @__PURE__ */ react.default.createElement("div", { className: "pisell-product-card-price" }, isEn ? fromText : "", /* @__PURE__ */ react.default.createElement(_pisell_materials.PisellText.Amount, {
		value: price,
		showCurrencySymbol: true
	}), !isEn ? fromText : "")), showArrow && /* @__PURE__ */ react.default.createElement("div", { className: "pisell-product-card-arrow" }, /* @__PURE__ */ react.default.createElement(_pisell_materials.Iconfont, { type: "pisell2-chevron-right" }))));
};
//#endregion
exports.default = PisellProductCard;
