const require_runtime = require("../../../../../_virtual/_rolldown/runtime.js");
const require_index = require("../../collapsibleList/index.js");
const require_utils = require("../../collapsibleList/utils.js");
const require_index$1 = require("../../browserSelect/index.js");
let react = require("react");
react = require_runtime.__toESM(react);
let _pisell_utils = require("@pisell/utils");
let classnames = require("classnames");
classnames = require_runtime.__toESM(classnames);
require("./index.less");
//#region src/components/booking/components/TabProduct/selectProductItem/index.tsx
const SelectProductItem = ({ item, onClick, onChangeQuantity, amountSymbol, style, className, disabled }) => {
	var _item$_extend, _item$_extend2;
	const list = (0, _pisell_utils.createArray)(100, (d, i) => {
		let item = {
			label: i,
			value: i
		};
		if (i === 0) item.label = _pisell_utils.locales.getText("pisell2.text.remove");
		return item;
	});
	return /* @__PURE__ */ react.default.createElement("div", {
		style,
		className: (0, classnames.default)("server-select-product", className),
		onClick: () => {
			onClick === null || onClick === void 0 || onClick(item);
		}
	}, item.cover ? /* @__PURE__ */ react.default.createElement("img", {
		src: _pisell_utils.image.ali(item.cover, 100),
		className: "server-select-product-cover"
	}) : /* @__PURE__ */ react.default.createElement("div", null), /* @__PURE__ */ react.default.createElement("div", { className: "server-select-product-content" }, /* @__PURE__ */ react.default.createElement("div", { className: "server-select-product-title" }, item.title), /* @__PURE__ */ react.default.createElement("div", { className: "server-select-product-subtitle" }, item.subtitle || ""), (((_item$_extend = item._extend) === null || _item$_extend === void 0 || (_item$_extend = _item$_extend.other) === null || _item$_extend === void 0 ? void 0 : _item$_extend.bundle) || []).length ? /* @__PURE__ */ react.default.createElement(require_index.default, {
		style: { width: "100%" },
		list: ((_item$_extend2 = item._extend) === null || _item$_extend2 === void 0 || (_item$_extend2 = _item$_extend2.other) === null || _item$_extend2 === void 0 ? void 0 : _item$_extend2.bundle) || [],
		renderItem: (item) => require_utils.renderBundles(item, amountSymbol)
	}) : null, /* @__PURE__ */ react.default.createElement("div", {
		className: "server-select-product-quantity",
		onClick: (e) => {
			e.preventDefault();
			e.stopPropagation();
		}
	}, /* @__PURE__ */ react.default.createElement(require_index$1.default, {
		options: list,
		value: item._extend.quantity,
		onChange: onChangeQuantity,
		style: { minWidth: 50 },
		disabled
	}), /* @__PURE__ */ react.default.createElement("div", { className: "server-select-product-total" }, item._extend.origin_total !== item._extend.total && /* @__PURE__ */ react.default.createElement("span", { className: "server-select-product-origin-total" }, (0, _pisell_utils.formatAmount)(item._extend.origin_total * item._extend.quantity, 2, amountSymbol)), (0, _pisell_utils.formatAmount)(item._extend.total * item._extend.quantity, 2, amountSymbol)))));
};
//#endregion
exports.default = SelectProductItem;
