import {CouponsPlus} from "../../globals";
import getSymbolFromCurrency from "currency-symbol-map";

export const renderCurrencyValue = (value: React.ReactNode): React.ReactNode => {
    const currencySymbol = getSymbolFromCurrency(CouponsPlus.WooCommerce.currency);

    return <>
        {CouponsPlus.WooCommerce.currencyPosition.startsWith('left') && currencySymbol}
        {value}
        {CouponsPlus.WooCommerce.currencyPosition.startsWith('right') && currencySymbol}
    </>
}