import{j as t}from"./vendor-react-DrAK5R0M.js";import{C as i}from"./index-7eqLqzhB.js";import{bi as f,an as h}from"./vendor-icons-Cu2Ube6F.js";const p=[25,50,100];function b(e,s){if(s<=7)return Array.from({length:s},(n,d)=>d+1);const r=[1];e>3&&r.push("...");for(let n=Math.max(2,e-1);n<=Math.min(s-1,e+1);n++)r.push(n);return e<s-2&&r.push("..."),r.push(s),r}function v({page:e,pageSize:s,total:r,onPageChange:n,onPageSizeChange:d,className:l}){if(r<=s)return null;const a=Math.ceil(r/s),c=(e-1)*s+1,m=Math.min(e*s,r),u=b(e,a);return t.jsxs("div",{className:i("flex flex-wrap items-center justify-between gap-3 pt-3 pb-1",l),children:[t.jsxs("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:["Showing ",c,"–",m," of ",r]}),t.jsxs("div",{className:"flex items-center gap-0.5",children:[t.jsx("button",{onClick:()=>n(e-1),disabled:e===1,className:"p-1.5 rounded-lg text-muted-foreground hover:text-foreground hover:bg-muted disabled:opacity-30 disabled:cursor-not-allowed transition-colors","aria-label":"Previous page",children:t.jsx(f,{className:"w-4 h-4"})}),u.map((o,x)=>o==="..."?t.jsx("span",{className:"w-8 text-center text-xs text-muted-foreground select-none",children:"…"},`ellipsis-${x}`):t.jsx("button",{onClick:()=>n(o),className:i("w-8 h-8 rounded-lg text-xs font-semibold transition-colors",e===o?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground hover:bg-muted"),children:o},o)),t.jsx("button",{onClick:()=>n(e+1),disabled:e===a,className:"p-1.5 rounded-lg text-muted-foreground hover:text-foreground hover:bg-muted disabled:opacity-30 disabled:cursor-not-allowed transition-colors","aria-label":"Next page",children:t.jsx(h,{className:"w-4 h-4"})})]}),d&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx("span",{className:"text-xs text-muted-foreground",children:"Per page:"}),t.jsx("div",{className:"flex items-center gap-0.5 bg-muted rounded-lg p-0.5",children:p.map(o=>t.jsx("button",{onClick:()=>{d(o),n(1)},className:i("px-2 py-1 rounded-md text-xs font-medium transition-colors",s===o?"bg-card text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:o},o))})]})]})}export{v as P};
