import{Box as T,Flex as h}from"@chakra-ui/react";import d from"@emotion/styled";var g=d(T)``,u=d(T)`
  display: flex;
  align-items: center;
  flex: 1 0 auto;
  padding: 0.5rem 0;
`,C=d(T)``,f=d(h)`
  display: flex;
  align-items: center;
  flex: 1 0 auto;
  padding: 0.5rem 0;

  -ms-overflow-style: none; /* Internet Explorer 10+ */
  scrollbar-width: none; /* Firefox */

  &::-webkit-scrollbar {
    display: none; /* Safari and Chrome */
  }
`,c=d(h)`
  padding-right: 1rem;
`,p=d(h)`
  padding-right: 1rem;

  &:last-child {
    padding-right: 0;
  }
`,w=d(h)`
  min-height: 20vh;
  width: 100%;
  align-items: center;
  justify-content: center;
  flex-direction: column;
`;import{Box as k,Skeleton as z,Text as b,useMediaQuery as N}from"@chakra-ui/react";import{Fragment as v,jsx as e,jsxs as x}from"react/jsx-runtime";var W=({data:y,columns:o,isLoading:B=!1,itemsPerPage:R,emptyState:j={title:"No Mints Found!",subtitle:"We'll replenish soon. Check back later."}})=>{let[s]=N("(max-width: 768px)",{ssr:!1}),{title:F,subtitle:S}=j;return x(g,{children:[!s&&e(u,{children:o.map(({title:t,textAlign:m,sx:l},r)=>e(c,{...l,fontSize:"xs",fontWeight:"medium",justify:m==="right"&&"flex-end",color:"mutedForeground",children:t},t+r))}),e(v,{children:(()=>{if(B){let t=s?[o[0],o[o.length-1]]:o;return Array.from(Array(R).keys()).map((m,l)=>e(f,{borderBottom:"1px",borderColor:"muted",children:t.map(({render:r,sx:a,textAlign:i},n)=>e(p,{...a,width:s?"50%":"100%",justify:i==="right"&&"flex-end",children:e(z,{speed:.6,height:8,width:s?"80%":"60%",startColor:"muted",endColor:"primary",opacity:.1,sx:{borderRadius:"md"}})},n+n))},l))}else return x(C,{children:[y.map((t,m)=>{if(s){let l=o.slice(1,o.length-1);return x(k,{children:[e(f,{children:[o[0],o[o.length-1]].map(({render:r,sx:a,textAlign:i},n)=>e(p,{...a,width:"50%",justify:i==="right"&&"flex-end",children:r&&r(t)},t.collectionId+n))}),e(f,{overflowX:"auto",children:l.map(({title:r,textAlign:a,sx:i,render:n},I)=>x(k,{width:`calc(100% / ${l.length})`,children:[e(c,{fontSize:"2xs",...i,minWidth:"50px",justify:"flex-start",color:"mutedForeground",children:r}),e(p,{...i,minWidth:"50px",justify:"flex-start",children:n&&n(t)})]},r+I))})]},t.collectionId)}return e(f,{borderBottom:"1px",borderColor:"muted",children:o.map(({render:l,sx:r,textAlign:a},i)=>e(p,{...r,justify:a==="right"&&"flex-end",children:l&&l(t)},t.collectionId+i))},t.collectionId)}),!y.length&&x(w,{children:[e(b,{fontSize:"md",children:F}),e(b,{fontSize:"sm",color:"mutedForeground",children:S})]})]})})()})]})},L=W;export{L as default};
