"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),o=require("@argent/x-shared"),k=require("../../features/icons/WarningCircleSecondaryIcon.cjs"),n=require("@chakra-ui/react"),m=require("react"),T=require("../../features/providers/CurrencyProvider.cjs"),f=require("../TextWithAmount.cjs"),l=require("../typography.generated.cjs"),g="Unknown NFT",q=({contractAddress:i,safe:j,dataIndex:p,totalData:y,isDisabled:b,isDefaultNetwork:C,amount:c,usdValue:u,nft:r,collection:t})=>{const{colorMode:x}=n.useColorMode(),h=m.useMemo(()=>x==="dark",[x]),d=T.useCurrency(),s=m.useCallback((a,N)=>o.generateAvatarImage(N??g,{background:o.getColor(a)}),[]),_=m.useMemo(()=>{if(r&&r.name)return{name:r.name,description:r.description,image_url_copy:r.image_url_copy??r.image_uri??s(i,r.name)};if(t){const a=t.name??"Unknown Collection";return{name:`${a} NFT`,description:`${a} NFT`,image_url_copy:t.imageUri??s(i)}}return{name:g,description:g,image_url_copy:s(i)}},[i,t,r,s]);return e.jsxs(n.AccordionButton,{display:"flex",width:"100%",justifyContent:"space-between",outline:"none",px:"3",pb:p!==y-1?"3":"3.5",_expanded:{backgroundColor:h?"neutrals.700":"gray.50",pb:"3.5"},disabled:b,_disabled:{cursor:"auto",opacity:1},_hover:{backgroundColor:b?"":h?"neutrals.700":"gray.50",borderBottomRadius:p===y-1?"xl":"0"},children:[e.jsxs(n.Flex,{alignItems:"center",gap:"2",children:[e.jsx(n.Image,{src:o.getNftPicture({image_url_copy:_.image_url_copy})||"",w:"5",h:"5",borderRadius:"base"}),e.jsx(l.P3,{fontWeight:"bold",color:"text-primary",children:_.name}),!j&&e.jsx(l.P2,{color:"error.500",fontWeight:"bold",mt:"0.25",children:e.jsx(k,{})})]}),e.jsxs(n.Flex,{direction:"column",gap:"0.5",alignItems:"flex-end",children:[e.jsx(f.TextWithAmount,{amount:c,children:e.jsx(l.P3,{color:c<0n?"error.500":"secondary.500",fontWeight:"bold",children:o.prettifyTokenAmount({amount:c,decimals:0,symbol:"NFT",showPlusSign:!0})})}),C&&!!u&&u!=="0"&&e.jsx(l.Label2Bold,{color:"neutrals.300",children:o.prettifyCurrencyValue(o.bigDecimal.parseCurrencyAbs(u).toString(),d==null?void 0:d.symbol)})]})]})};exports.NftDetails=q;
