import"react";import{Box as g,Button as B,Flex as r,Text as o}from"@chakra-ui/react";import S from"@emotion/styled";import{jsx as s,jsxs as t}from"react/jsx-runtime";var z=S(o)`
  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;
  }
`,L=({selected:e,onSelect:c,onUnSelect:a,domain:d,currency:i})=>{let{name:x,availability:u,rate:h,discountedRate:f,discount:p}=d,{price:m,status:n}=u,{subTotal:{usdCents:l}}=m,W=T=>{T.stopPropagation(),a()},A=()=>{if(n==="NOT_AVAILABLE")return"Sold";if(e)return"Selected";if(!e)return"Select"},b=()=>{e?a():e||c()};return s(g,{position:"relative",paddingY:2,mb:3,zIndex:"1",border:"1px solid #cccccc",borderRadius:10,flexDir:"row",children:t(r,{paddingX:3,align:"center",justify:"space-between",flexDir:"row",children:[s(o,{fontSize:14,children:x}),t(r,{align:"center",children:[n==="AVAILABLE"&&t(g,{mr:4,children:[t(o,{textAlign:"center",fontSize:12,fontWeight:600,children:[f[i]??l/100," ",i," ",t("span",{style:{fontWeight:600},children:["($",f.USDT,")"]})]}),p>0&&t(r,{children:[t(z,{textAlign:"center",fontSize:10,fontWeight:500,lineHeight:1,children:[h[i]??l/100," ",i," ",t("span",{style:{fontWeight:400},children:["($",l/100,")"]})]}),t(o,{ml:1,textAlign:"center",fontSize:10,fontWeight:500,lineHeight:1,color:"green",children:["(",p,"% off)"]})]})]}),s(B,{size:"sm",variant:"outline",bg:e?"input":"initial",minWidth:"20",onClick:b,isDisabled:n==="NOT_AVAILABLE",children:A()})]})]})})},I=L;export{I as default};
