"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),c=require("@argent/x-shared"),a=require("@chakra-ui/react"),u=require("react-i18next"),d=require("./TokenIcon.cjs");require("./Typography.cjs");const l=require("./typography.generated.cjs");function m({onClick:i,token:e,iconSize:s="10",...o}){const{t}=u.useTranslation(),n=c.bigDecimal.formatUnits({value:BigInt(e.balance??0),decimals:e.decimals??18});return r.jsxs(a.Flex,{p:"4",gap:"3",cursor:"pointer",bg:"surface-elevated",borderRadius:"lg",_hover:{bg:"surface-elevated-web"},...o,onClick:()=>i(e),children:[r.jsx(d.TokenIcon,{iconUrl:e.iconUrl,name:e.name||"",size:s,borderRadius:"50%"}),r.jsxs(a.Flex,{flexDirection:"column",flex:"1",justifyContent:"center",children:[r.jsx(l.H5,{children:c.isEqualAddress(e.address,c.ETH_TOKEN_ADDRESS)?t("tokenRow.ethereum"):e.name}),e.symbol&&r.jsx(l.P3,{color:"text-secondary",children:e.symbol})]}),r.jsxs(a.Flex,{flexDirection:"column",alignItems:"flex-end",children:[Number(e.balance)>0&&n&&r.jsx(l.P4,{fontWeight:"bold",fontSize:"sm",gap:"0.5",children:c.prettifyTokenNumber(n,n.length<12?{minDecimalPlaces:4,maxDecimalPlaces:6}:{minDecimalPlaces:4,maxDecimalPlaces:12})}),Number(e.currencyValue)>0&&e.currencyValue&&r.jsx(l.P4,{fontWeight:"bold",color:"text-secondary-web",children:c.prettifyCurrencyValue(e.currencyValue,e.currencySymbol)})]})]})}exports.TokenRow=m;
