import { _objectWithoutProperties } from "../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectWithoutProperties.js";
import usePisellConfig from "../../../pisell-config-provider/hooks/usePisellConfig.js";
import React, { useMemo } from "react";
import { formatAmountWithOptions } from "@pisell/utils";
//#region src/components/pisellText/components/Amount/index.tsx
const _excluded = [
	"value",
	"precision",
	"showCurrencySymbol",
	"useThousandsSeparator",
	"hideDecimalForWholeNumbers",
	"symbol"
];
const Amount = (props) => {
	const { value, precision, showCurrencySymbol, useThousandsSeparator, hideDecimalForWholeNumbers, symbol } = props, others = _objectWithoutProperties(props, _excluded);
	const config = usePisellConfig();
	const amount = useMemo(() => {
		var _config$getSymbolic;
		return formatAmountWithOptions(value, symbol || (config === null || config === void 0 ? void 0 : config.symbol) || (config === null || config === void 0 || (_config$getSymbolic = config.getSymbolic) === null || _config$getSymbolic === void 0 ? void 0 : _config$getSymbolic.call(config)) || "", {
			precision,
			showCurrencySymbol,
			useThousandsSeparator,
			hideDecimalForWholeNumbers
		});
	}, [
		value,
		precision,
		showCurrencySymbol,
		useThousandsSeparator,
		hideDecimalForWholeNumbers,
		config === null || config === void 0 ? void 0 : config.symbol
	]);
	return /* @__PURE__ */ React.createElement("span", others, amount);
};
//#endregion
export { Amount as default };
