"use strict";
Object.defineProperty(exports, "__esModule", {
    value: true
});
Object.defineProperty(exports, "NumeralTotal", {
    enumerable: true,
    get: function() {
        return NumeralTotal;
    }
});
const _jsxruntime = require("react/jsx-runtime");
const _numeral = require("../text/numeral");
const _react = require("react");
const _utils = require("@orderly.network/utils");
const NumeralTotal = (props)=>{
    const { price, quantity, ...rest } = props;
    //
    const children = (0, _react.useMemo)(()=>{
        if (!price || !quantity) {
            return 0;
        }
        return new _utils.Decimal(props.price).mul(props.quantity).toNumber();
    }, [
        price,
        quantity
    ]);
    return /*#__PURE__*/ (0, _jsxruntime.jsx)(_numeral.Numeral, {
        ...rest,
        children: children
    });
};

//# sourceMappingURL=numeralTotal.js.map