import useEngineContext from "../../../../hooks/useEngineContext.js";
import locales_default from "../../locales.js";
import React, { useMemo } from "react";
import { PisellText } from "@pisell/materials";
import classNames from "classnames";
import "./index.less";
//#region src/plus/productSelect/components/pisellPriceText/index.tsx
const index = (props) => {
	var _context$appHelper$ut;
	const context = useEngineContext();
	const { value, customPrefixText, customSuffixText } = props;
	const locale = ((_context$appHelper$ut = context.appHelper.utils) === null || _context$appHelper$ut === void 0 || (_context$appHelper$ut = _context$appHelper$ut.storage) === null || _context$appHelper$ut === void 0 ? void 0 : _context$appHelper$ut.get("umi_locale")) || "en";
	const [_prefix, _suffix] = useMemo(() => {
		if (!props.isMini) return ["", ""];
		const localText = locales_default[locale] || locales_default.en;
		return [customPrefixText || localText["pisell2.product-select.price.prefix"] || "From", customSuffixText || localText["pisell2.product-select.price.suffix"] || ""];
	}, [
		props.isMini,
		customPrefixText,
		customSuffixText,
		locale
	]);
	return /* @__PURE__ */ React.createElement("div", { className: classNames("pisell-price-text", props.className) }, props.prefix, _prefix ? /* @__PURE__ */ React.createElement("span", {
		className: "pisell-price-text-prefix-text",
		style: {
			fontSize: "0.65em",
			marginRight: 4
		}
	}, _prefix) : null, /* @__PURE__ */ React.createElement(PisellText.Amount, { value }), _suffix ? /* @__PURE__ */ React.createElement("span", {
		style: {
			fontSize: "0.65em",
			marginLeft: 4
		},
		className: "pisell-price-text-suffix-text"
	}, _suffix) : null, props.suffix);
};
//#endregion
export { index as default };
