const require_runtime = require("../../../../../_virtual/_rolldown/runtime.js");
const require_index = require("../../../../productSelect/components/pisellPriceText/index.js");
let react = require("react");
react = require_runtime.__toESM(react);
let _pisell_utils = require("@pisell/utils");
let decimal_js = require("decimal.js");
decimal_js = require_runtime.__toESM(decimal_js);
let classnames = require("classnames");
classnames = require_runtime.__toESM(classnames);
require("./index.less");
//#region src/components/productExtension/fields/SelectProducts/ProductItem/index.tsx
const ProductItem = ({ item = {}, onClick, amountSymbol = "$", style, className }) => {
	const { price, is_bundle, minimum_markup_price } = item;
	let _price = price;
	if (is_bundle) _price = new decimal_js.default(price).plus(new decimal_js.default(minimum_markup_price)).toFixed(2);
	return /* @__PURE__ */ react.default.createElement("div", {
		style,
		className: (0, classnames.default)("product-item-card", className),
		onClick: () => {
			onClick(item);
		}
	}, item.cover ? /* @__PURE__ */ react.default.createElement("img", {
		src: _pisell_utils.image.ali(item.cover, 100),
		className: "product-item-card-cover"
	}) : null, /* @__PURE__ */ react.default.createElement("div", { className: "product-item-card-content" }, /* @__PURE__ */ react.default.createElement("div", { className: "product-item-card-title" }, item.title), /* @__PURE__ */ react.default.createElement("div", { className: "product-item-card-price" }, /* @__PURE__ */ react.default.createElement(require_index.default, {
		value: _price,
		isMini: is_bundle
	}))));
};
//#endregion
exports.default = ProductItem;
