import{o as e,r as t,t as n}from"./jsx-runtime-BbTa8W_M-1776590214964.js";import{t as r}from"./useTranslation-D1etqd9u-1776590214964.js";import{t as i}from"./chevron-left-BPh9np_P-1776590214964.js";import{t as a}from"./chevron-right-CQG1mCkM-1776590214964.js";var o=e(t(),1),s=n();function c({counts:e,currentStatus:t,changeTab:n}){let{t:c}=r(),l=(0,o.useRef)(null),[u,d]=(0,o.useState)(!1),[f,p]=(0,o.useState)(!1),m=()=>{if(l.current){let{scrollLeft:e,scrollWidth:t,clientWidth:n}=l.current;d(e>0),p(e<t-n-5)}};(0,o.useEffect)(()=>(m(),window.addEventListener(`resize`,m),()=>window.removeEventListener(`resize`,m)),[e]);let h=e=>{if(l.current){let t=e===`left`?-200:200;l.current.scrollBy({left:t,behavior:`smooth`})}},g=[{id:`all`,label:c(`All Orders`),count:e.all},{id:`pending`,label:c(`Awaiting Payment`),count:e.pending},{id:`processing`,label:c(`To Ship`),count:e.processing},{id:`shipped`,label:c(`Shipped`),count:e.shipped},{id:`completed`,label:c(`Completed`),count:e.completed},{id:`refund_requests`,label:c(`Refund Requests`),count:e.refund_requests||0},{id:`cancelled`,label:c(`Cancelled`),count:e.cancelled||0}];return(0,s.jsxs)(`div`,{className:`relative group w-full border-b border-border/60 bg-card rounded-t-xl mb-4 overflow-hidden`,children:[u&&(0,s.jsx)(`button`,{onClick:()=>h(`left`),className:`absolute left-0 top-0 bottom-0 z-10 w-12 bg-gradient-to-r from-card via-card/90 to-transparent flex items-center justify-start pl-2 text-primary md:hidden`,children:(0,s.jsx)(i,{className:`w-5 h-5 animate-pulse`})}),(0,s.jsx)(`div`,{ref:l,onScroll:m,className:`flex w-full overflow-x-auto no-scrollbar scroll-smooth px-4`,children:(0,s.jsx)(`div`,{className:`flex w-max gap-4 sm:gap-6`,children:g.map(e=>(0,s.jsxs)(`button`,{onClick:()=>n(e.id),className:`shrink-0 py-4 px-1 text-sm font-bold border-b-2 transition-all whitespace-nowrap flex items-center gap-2 ${t===e.id?`border-primary text-primary`:`border-transparent text-muted-foreground hover:text-foreground`}`,children:[e.label,(0,s.jsx)(`span`,{className:`px-2 py-0.5 rounded-full text-[10px] ${t===e.id?`bg-primary/10 text-primary`:`bg-muted text-muted-foreground`}`,children:e.count})]},e.id))})}),f&&(0,s.jsx)(`button`,{onClick:()=>h(`right`),className:`absolute right-0 top-0 bottom-0 z-10 w-12 bg-gradient-to-l from-card via-card/90 to-transparent flex items-center justify-end pr-2 text-primary md:hidden`,children:(0,s.jsx)(a,{className:`w-5 h-5 animate-pulse`})})]})}export{c as default};