@sofaws/dapp-core
Version:
A library to hold the main logic for a dapp on the Elrond Network
3 lines (2 loc) • 1.56 kB
JavaScript
import{b as s}from"./chunk-PDW7SVKQ.js";import{b as p}from"./chunk-I2NWMXXW.js";import{a as L}from"./chunk-V4XSYEH7.js";import{a as I}from"./chunk-QFTWB3KE.js";import{e as g,f as y,r as i,s as D}from"./chunk-ZR7YL3KO.js";import{g as N}from"./chunk-NXNVZGZT.js";import{a as r,b as f,m as A}from"./chunk-HBP5N4FR.js";A();import a from"react";import C from"classnames";D();var E=t=>a.createElement("span",{"data-testid":t["data-testid"]?t["data-testid"]:"formatAmountComponent",className:t.className},a.createElement("span",{className:s["int-amount"],"data-testid":"formatAmountInt"},"...")),v=(t,o)=>{var u;let{value:n,showLastNonZeroDecimal:b=!1,showLabel:F=!0}=t,e=t.digits!=null?t.digits:y,P=t.decimals!=null?t.decimals:g,d=L({input:n,decimals:P,digits:e,showLastNonZeroDecimal:b,addCommas:!0}),m=d.split("."),T=m.length===1,h=d!==i;if(e>0&&T&&h){let l="";for(let c=1;c<=e;c++)l=l+i;m.push(l)}return a.createElement("span",{"data-testid":t["data-testid"]?t["data-testid"]:"formatAmountComponent",className:t.className},a.createElement("span",{className:s["int-amount"],"data-testid":"formatAmountInt"},m[0]),m.length>1&&a.createElement("span",{className:s.decimals,"data-testid":"formatAmountDecimals"},".",m[1]),F&&a.createElement("span",{className:C(s.symbol,t.token&&p.textMuted),"data-testid":"formatAmountSymbol"},` ${(u=t.token)!=null?u:o}`))},S=t=>{let{value:o}=t;return I(o)?v(t,t.egldLabel||""):E(t)},O=t=>{let o=t.egldLabel||N,n=f(r({},t),{egldLabel:o});return a.createElement(S,r({},n))};export{O as a};
//# sourceMappingURL=chunk-TAHC5Y63.js.map