import{j as o}from"./index-C7Y5J1TO.js";import{P as e,a as f,b as l,c as j,e as m,d as p,f as c}from"./pagination-DcGqVpvk.js";function k({currentPage:i,totalItems:x,itemsPerPage:h,onPageChange:t}){const s=Math.ceil(x/h),d=()=>{const n=[];if(s<=5)for(let a=1;a<=s;a++)n.push(a);else i<=3?n.push(1,2,3,4,-1,s):i>=s-2?n.push(1,-1,s-3,s-2,s-1,s):n.push(1,-1,i-1,i,i+1,-1,s);return n};return o.jsx(e,{children:o.jsxs(f,{children:[o.jsx(l,{children:o.jsx(j,{href:"#",onClick:()=>t(i-1),"aria-disabled":i===1})}),d().map((n,a)=>o.jsx(l,{children:n===-1?o.jsx(m,{}):o.jsx(p,{href:"#",isActive:n===i,onClick:()=>t(n),children:n})},a)),o.jsx(l,{children:o.jsx(c,{href:"#",onClick:()=>t(i+1),"aria-disabled":i===s})})]})})}export{k as M};
