"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),i=require("@argent/x-shared"),h=require("../../../providers/TokenProvider.cjs"),n=require("@chakra-ui/react"),v=require("react-i18next"),S=require("../Hideable.cjs"),b=require("../icon/TokenActivitySummaryIcon.cjs"),T=require("./ActivityRowSubtitle.cjs"),f=require("./getAttributes.cjs"),p=require("../../../../components/TokenIcon.cjs"),o=require("../../../../components/typography.generated.cjs"),q=({summary:t,networkId:s,hideComponent:y})=>{var a,d;const{t:m}=v.useTranslation(),x=t.asset.tokenAddress,r=h.useTokenInfo({networkId:s,address:x});if(!r)return e.jsx(n.Flex,{alignItems:"center",w:"full",children:e.jsxs(n.Flex,{gap:"2",alignItems:"center",children:[e.jsx(p.UnknownTokenIcon,{size:7}),e.jsx(o.B3,{children:m("tokenActivitySummaryRow.unknownToken")})]})});const c=t.asset.amount||0,l=(a=t.asset.fiatAmount)==null?void 0:a.currencyAmount,g=i.getCurrencySymbol(((d=t.asset.fiatAmount)==null?void 0:d.currency)??"USD"),u=i.prettifyTokenAmount({amount:c,decimals:i.ensureDecimals(r.decimals),symbol:r.symbol}),{color:A,prefix:j}=f.getAttributes(t),k=i.prettifyCurrencyValue(l,g);return e.jsxs(n.Flex,{alignItems:"center",w:"full",children:[e.jsxs(n.Flex,{gap:"2",alignItems:"center",children:[e.jsx(b.TokenActivitySummaryIcon,{summary:t,size:7,networkId:s}),e.jsx(o.B3,{children:r.name})]}),e.jsx(n.Flex,{ml:"auto",gap:1,direction:"column",textAlign:"right",children:e.jsxs(S.Hideable,{hideComponent:y,children:[e.jsxs(o.B3,{color:A,"data-tx-value":c,"data-fe-value":u,children:[j,u]}),l!==void 0&&e.jsx(T.ActivityRowSubtitle,{children:k})]})})]})};exports.TokenActivitySummaryRow=q;
