"use strict";var e=require("react/jsx-runtime"),j=require("../containers/button.js");require("../containers/card.js");var k=require("../../lib/cn.js");require("../primitives/button.js"),require("../primitives/checkbox.js"),require("../primitives/dropdown-selector.js"),require("../primitives/popover.js"),require("../primitives/radio.js"),require("../primitives/segmented-control.js"),require("../primitives/switch.js");var u=require("../primitives/text.js"),d=require("react");require("../utils/client-asset-logo.js"),require("react-qrcode-logo"),require("../utils/secured-by-magic.js");var p=require("../logos/icon-generic-token.js");require("../containers/header.js"),require("../containers/menu.js"),require("../containers/modal.js"),require("../containers/overlay.js"),require("../feedback/callout.js");var m=require("../feedback/skeleton.js");require("../primitives/portal.js"),require("../../hooks/useToast.js"),require("../feedback/tooltip.js");var x=require("create-slots");const g=x.createSlot(({children:t,...r})=>e.jsx("div",{className:"flex items-center justify-center",children:d.Children.map(t,i=>d.cloneElement(i,r))})),q=({name:t,fiatBalanceWithSymbol:r,tokenBalanceWithSymbol:i,tokenIcon:n,logoUrl:l,tokenBalanceFirst:s,disabled:c=!1,isLoading:a=!1})=>{const o=s||!r;return e.jsxs("div",{className:k.cn("flex flex-row items-center w-full justify-between",c?"opacity-50":"opacity-100"),children:[e.jsxs("div",{className:"flex flex-row items-center gap-4",children:[n?{...n,props:{...n.props,width:40,height:40}}:l?e.jsx("img",{width:40,height:40,src:l,alt:`${t} logo`}):e.jsx(p.default,{width:40,height:40}),e.jsx(u.default,{fontWeight:"medium",styles:{textTransform:"capitalize",textAlign:"left"},children:t})]}),e.jsx("div",{className:"flex flex-col gap-0 items-end",children:a?e.jsxs(e.Fragment,{children:[e.jsx(m.Skeleton,{height:"1rem",width:"6rem"}),i&&r&&e.jsx("div",{style:{marginTop:"4px"},children:e.jsx(m.Skeleton,{height:"1rem",width:"4rem"})})]}):e.jsxs(e.Fragment,{children:[e.jsx(u.default,{size:"sm",styles:{lineHeight:"1.5rem",textAlign:"right"},children:o?i:r}),e.jsx(u.default,{size:"sm",fontColor:"text.secondary",styles:{lineHeight:"1.5rem",textAlign:"right"},children:o?r:i})]})})]})},v=t=>{const{name:r,fiatBalanceWithSymbol:i,tokenBalanceWithSymbol:n,logoUrl:l,onPress:s,tokenBalanceFirst:c,disabled:a,isLoading:o}=t,f=d.useRef(null),y=d.useCallback(()=>{s?.()},[s]);return x.createHost(t.children,b=>{const h=b.get(g);return s?e.jsx(j.ButtonContainer,{ref:f,className:"dark:bg-surface-tertiary hover:bg-neutral-secondary bg-neutral-quaternary px-4 py-2 min-h-[4rem]",borderRadius:"0.5rem",expand:!0,onPress:a?void 0:y,disabled:a,children:e.jsx(q,{name:r,fiatBalanceWithSymbol:i,tokenBalanceWithSymbol:n,tokenIcon:h,logoUrl:l,tokenBalanceFirst:c,disabled:a,isLoading:o})}):e.jsx(q,{name:r,fiatBalanceWithSymbol:i,tokenBalanceWithSymbol:n,tokenIcon:h,logoUrl:l,tokenBalanceFirst:c,disabled:a,isLoading:o})})},B=Object.assign(v,{TokenIcon:g});exports.TokenListItem=B;
//# sourceMappingURL=token-list-item.js.map
