import{j as t,a as b}from"./app-BwDemWQz.js";import{B as o}from"./Button-B-KWyoQR.js";function N({links:s,currentPage:y,lastPage:d,preserveState:i=!0,preserveScroll:m=!0,only:n=[],className:x=""}){if(!s||d<=1)return null;const l=e=>{e&&b.get(e,{},{preserveState:i,preserveScroll:m,only:n})},h=s.filter(e=>e.label!=="&laquo; Previous"&&e.label!=="Next &raquo;"&&!e.label.includes("Previous")&&!e.label.includes("Next")),r=s.find(e=>e.label==="&laquo; Previous"||e.label.includes("Previous")),a=s.find(e=>e.label==="Next &raquo;"||e.label.includes("Next"));return t.jsxs("div",{className:`flex items-center justify-center gap-2 ${x}`,children:[t.jsx(o,{variant:"ghost",size:"sm",className:`${r!=null&&r.url?"text-gray-600 hover:text-gray-800":"text-gray-400 cursor-not-allowed"}`,onClick:()=>l(r==null?void 0:r.url),disabled:!(r!=null&&r.url),children:"<"}),h.map((e,c)=>{if(e.label==="...")return t.jsx("span",{className:"text-gray-400 mx-1",children:"..."},`ellipsis-${c}`);const u=e.active,g=e.label;return t.jsx(o,{size:"sm",variant:u?"default":"ghost",className:u?"bg-gradient-to-r from-primary to-secondary text-white hover:from-sky-600 hover:to-cyan-600":"text-gray-600 hover:text-gray-800 hover:bg-gray-100",onClick:()=>l(e.url),disabled:!e.url,children:g},`page-${g}-${c}`)}),t.jsx(o,{variant:"ghost",size:"sm",className:`${a!=null&&a.url?"text-gray-600 hover:text-gray-800":"text-gray-400 cursor-not-allowed"}`,onClick:()=>l(a==null?void 0:a.url),disabled:!(a!=null&&a.url),children:">"})]})}export{N as P};
