import{jsx as t,jsxs as c,Fragment as d}from"react/jsx-runtime";import{ButtonContainer as x}from"../containers/button.js";import"../containers/card.js";import{css as S}from"@styled/css";import{Center as W,HStack as g,VStack as w}from"@styled/jsx";import"@styled/tokens";import"../primitives/button.js";import"../primitives/checkbox.js";import"../primitives/dropdown-selector.js";import"../primitives/popover.js";import"../primitives/radio.js";import"../primitives/segmented-control.js";import"../primitives/switch.js";import p from"../primitives/text.js";import{Children as I,cloneElement as C,useRef as F,useCallback as H}from"react";import"../utils/client-asset-logo.js";import"react-qrcode-logo";import"../utils/secured-by-magic.js";import L from"../logos/icon-generic-token.js";import"../containers/header.js";import"../containers/menu.js";import"../containers/modal.js";import"../containers/overlay.js";import"../feedback/callout.js";import"../feedback/progress-bar.js";import{Skeleton as f}from"../feedback/skeleton.js";import"../primitives/portal.js";import"../../hooks/useToast.js";import"../../recipes/toast.js";import"../feedback/tooltip.js";import{createSlot as j,createHost as v}from"create-slots";const b=j(({children:o,...e})=>t(W,{children:I.map(o,i=>C(i,e))})),k=({name:o,fiatBalanceWithSymbol:e,tokenBalanceWithSymbol:i,tokenIcon:r,logoUrl:l,tokenBalanceFirst:a,disabled:s=!1,isLoading:n=!1})=>{const m=a||!e;return c(g,{w:"full",justify:"space-between",opacity:s?"0.5":"1",children:[c(g,{gap:4,children:[r?{...r,props:{...r.props,width:40,height:40}}:l?t("img",{width:40,height:40,src:l,alt:`${o} logo`}):t(L,{width:40,height:40}),t(p,{fontWeight:"medium",styles:{textTransform:"capitalize"},children:o})]}),t(w,{gap:0,alignItems:"flex-end",children:n?c(d,{children:[t(f,{height:"1rem",width:"6rem"}),i&&e&&t("div",{style:{marginTop:"4px"},children:t(f,{height:"1rem",width:"4rem"})})]}):c(d,{children:[t(p,{size:"sm",styles:{lineHeight:"1.5rem",textAlign:"right"},children:m?i:e}),t(p,{size:"sm",fontColor:"text.secondary",styles:{lineHeight:"1.5rem",textAlign:"right"},children:m?e:i})]})})]})},T=o=>{const{name:e,fiatBalanceWithSymbol:i,tokenBalanceWithSymbol:r,logoUrl:l,onPress:a,tokenBalanceFirst:s,disabled:n,isLoading:m}=o,y=F(null),u=H(()=>{a?.()},[a]);return v(o.children,B=>{const h=B.get(b);return a?t(x,{ref:y,className:S({_dark:{bg:"surface.tertiary"},_hover:{bg:"neutral.secondary"},bg:"neutral.quaternary",px:4,py:2,minH:16}),borderRadius:"0.5rem",expand:!0,onPress:n?void 0:u,disabled:n,children:t(k,{name:e,fiatBalanceWithSymbol:i,tokenBalanceWithSymbol:r,tokenIcon:h,logoUrl:l,tokenBalanceFirst:s,disabled:n,isLoading:m})}):t(k,{name:e,fiatBalanceWithSymbol:i,tokenBalanceWithSymbol:r,tokenIcon:h,logoUrl:l,tokenBalanceFirst:s,disabled:n,isLoading:m})})},U=Object.assign(T,{TokenIcon:b});export{U as TokenListItem};
//# sourceMappingURL=token-list-item.js.map
