import { jsx as _jsx } from "react/jsx-runtime";
import { Numeral } from "../text/numeral";
import { useMemo } from "react";
import { Decimal } from "@orderly.network/utils";
export const NumeralTotal = (props)=>{
    const { price, quantity, ...rest } = props;
    //
    const children = useMemo(()=>{
        if (!price || !quantity) {
            return 0;
        }
        return new Decimal(props.price).mul(props.quantity).toNumber();
    }, [
        price,
        quantity
    ]);
    return /*#__PURE__*/ _jsx(Numeral, {
        ...rest,
        children: children
    });
};

//# sourceMappingURL=numeralTotal.js.map