import{jsx as e,jsxs as c,Fragment as p}from"react/jsx-runtime";import{ButtonContainer as k}from"../containers/button.js";import"../containers/card.js";import{cn as B}from"../../lib/cn.js";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 d from"../primitives/text.js";import{Children as S,cloneElement as w,useRef as W,useCallback as v}from"react";import"../utils/client-asset-logo.js";import"react-qrcode-logo";import"../utils/secured-by-magic.js";import I 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{Skeleton as g}from"../feedback/skeleton.js";import"../primitives/portal.js";import"../../hooks/useToast.js";import"../feedback/tooltip.js";import{createSlot as j,createHost as F}from"create-slots";const f=j(({children:o,...t})=>e("div",{className:"flex items-center justify-center",children:S.map(o,i=>w(i,t))})),y=({name:o,fiatBalanceWithSymbol:t,tokenBalanceWithSymbol:i,tokenIcon:r,logoUrl:l,tokenBalanceFirst:a,disabled:s=!1,isLoading:n=!1})=>{const m=a||!t;return c("div",{className:B("flex flex-row items-center w-full justify-between",s?"opacity-50":"opacity-100"),children:[c("div",{className:"flex flex-row items-center gap-4",children:[r?{...r,props:{...r.props,width:40,height:40}}:l?e("img",{width:40,height:40,src:l,alt:`${o} logo`}):e(I,{width:40,height:40}),e(d,{fontWeight:"medium",styles:{textTransform:"capitalize",textAlign:"left"},children:o})]}),e("div",{className:"flex flex-col gap-0 items-end",children:n?c(p,{children:[e(g,{height:"1rem",width:"6rem"}),i&&t&&e("div",{style:{marginTop:"4px"},children:e(g,{height:"1rem",width:"4rem"})})]}):c(p,{children:[e(d,{size:"sm",styles:{lineHeight:"1.5rem",textAlign:"right"},children:m?i:t}),e(d,{size:"sm",fontColor:"text.secondary",styles:{lineHeight:"1.5rem",textAlign:"right"},children:m?t:i})]})})]})},L=o=>{const{name:t,fiatBalanceWithSymbol:i,tokenBalanceWithSymbol:r,logoUrl:l,onPress:a,tokenBalanceFirst:s,disabled:n,isLoading:m}=o,b=W(null),x=v(()=>{a?.()},[a]);return F(o.children,u=>{const h=u.get(f);return a?e(k,{ref:b,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:n?void 0:x,disabled:n,children:e(y,{name:t,fiatBalanceWithSymbol:i,tokenBalanceWithSymbol:r,tokenIcon:h,logoUrl:l,tokenBalanceFirst:s,disabled:n,isLoading:m})}):e(y,{name:t,fiatBalanceWithSymbol:i,tokenBalanceWithSymbol:r,tokenIcon:h,logoUrl:l,tokenBalanceFirst:s,disabled:n,isLoading:m})})},N=Object.assign(L,{TokenIcon:f});export{N as TokenListItem};
//# sourceMappingURL=token-list-item.js.map
