import{Box as g,Button as B,Flex as a,Text as i}from"@chakra-ui/react";import z from"@emotion/styled";import{jsx as l,jsxs as t}from"react/jsx-runtime";var C=z(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;
  }
`,L=({selected:e,onSelect:x,onUnSelect:s,domain:u,currency:n})=>{var p,d;let{name:h,availability:m,rate:A,discountedRate:c,discount:f}=u,{price:b,status:o}=m,{subTotal:{usdCents:r}}=b,W=y=>{y.stopPropagation(),s()},S=()=>{if(o==="NOT_AVAILABLE")return"Sold";if(e)return"Selected";if(!e)return"Select"},T=()=>{e?s():e||x()};return l(g,{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:h}),t(a,{align:"center",children:[o==="AVAILABLE"&&t(g,{mr:4,children:[t(i,{textAlign:"center",fontSize:12,fontWeight:600,children:[(p=c[n])!=null?p:r/100," ",n," ",t("span",{style:{fontWeight:600},children:["($",c.USDT,")"]})]}),f>0&&t(a,{children:[t(C,{textAlign:"center",fontSize:10,fontWeight:500,lineHeight:1,children:[(d=A[n])!=null?d: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(B,{size:"sm",variant:"outline",bg:e?"input":"initial",minWidth:24,onClick:T,isDisabled:o==="NOT_AVAILABLE",children:S()})]})]})})},D=L;export{D as default};
