import{Box as p,Button as T,Flex as a,Text as i}from"@chakra-ui/react";import y from"@emotion/styled";import{jsx as l,jsxs as t}from"react/jsx-runtime";var B=y(i)`
  position: relative;
  width: fit-content;
  margin: 0 auto;

  &:after {
    content: '';
    border-top: 1px solid #2d3748;
    width: 100%;
    height: 1px;
    position: absolute;
    top: 50%;
    left: 0;
  }
`,z=({selected:e,onSelect:d,onUnSelect:s,domain:g,currency:n})=>{let{name:x,availability:u,rate:h,discountedRate:c,discount:f}=g,{price:m,status:o}=u,{subTotal:{usdCents:r}}=m,C=S=>{S.stopPropagation(),s()},A=()=>{if(o==="NOT_AVAILABLE")return"Sold";if(e)return"Selected";if(!e)return"Select"},b=()=>{e?s():e||d()};return l(p,{position:"relative",paddingY:2,mb:3,zIndex:"1",border:"1px solid #cccccc",borderRadius:10,flexDir:"row",children:t(a,{paddingX:3,align:"center",justify:"space-between",flexDir:"row",children:[l(i,{fontSize:14,children:x}),t(a,{align:"center",children:[o==="AVAILABLE"&&t(p,{mr:4,children:[t(i,{textAlign:"center",fontSize:12,fontWeight:600,children:[c[n]??r/100," ",n," ",t("span",{style:{fontWeight:600},children:["($",c.USDT,")"]})]}),f>0&&t(a,{children:[t(B,{textAlign:"center",fontSize:10,fontWeight:500,lineHeight:1,children:[h[n]??r/100," ",n," ",t("span",{style:{fontWeight:400},children:["($",r/100,")"]})]}),t(i,{ml:1,textAlign:"center",fontSize:10,fontWeight:500,lineHeight:1,color:"green",children:["(",f,"% off)"]})]})]}),l(T,{size:"sm",variant:"outline",bg:e?"input":"initial",minWidth:24,onClick:b,isDisabled:o==="NOT_AVAILABLE",children:A()})]})]})})},k=z;export{k as default};
