import index from "../../../../productSelect/components/pisellPriceText/index.js";
import React from "react";
import { image } from "@pisell/utils";
import Decimal from "decimal.js";
import classNames from "classnames";
import "./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(price).plus(new Decimal(minimum_markup_price)).toFixed(2);
	return /* @__PURE__ */ React.createElement("div", {
		style,
		className: classNames("product-item-card", className),
		onClick: () => {
			onClick(item);
		}
	}, item.cover ? /* @__PURE__ */ React.createElement("img", {
		src: image.ali(item.cover, 100),
		className: "product-item-card-cover"
	}) : null, /* @__PURE__ */ React.createElement("div", { className: "product-item-card-content" }, /* @__PURE__ */ React.createElement("div", { className: "product-item-card-title" }, item.title), /* @__PURE__ */ React.createElement("div", { className: "product-item-card-price" }, /* @__PURE__ */ React.createElement(index, {
		value: _price,
		isMini: is_bundle
	}))));
};
//#endregion
export { ProductItem as default };
