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