import{j as e}from"./index-TmnhPDhN.js";import{d as l}from"./AppLayout-D6Er1EDx.js";import{c as t}from"./apiClient-BjaOLWhY.js";const a=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],c=t("chevron-left",a);const m=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],x=t("chevron-right",m);function u({current:s,last:n,onPageChange:r}){if(n<=1)return null;const o=Array.from({length:n},(i,d)=>d+1).filter(i=>i===1||i===n||i>=s-1&&i<=s+1);return e.jsxs("div",{className:"flex items-center justify-between border-t border-border bg-card px-4 py-3 sm:px-6",children:[e.jsxs("div",{className:"flex flex-1 justify-between sm:hidden",children:[e.jsx("button",{disabled:s===1,onClick:()=>r(s-1),className:"relative inline-flex items-center rounded-md border border-border bg-card px-4 py-2 text-sm font-medium hover:bg-secondary disabled:opacity-50",children:"Previous"}),e.jsx("button",{disabled:s===n,onClick:()=>r(s+1),className:"relative ml-3 inline-flex items-center rounded-md border border-border bg-card px-4 py-2 text-sm font-medium hover:bg-secondary disabled:opacity-50",children:"Next"})]}),e.jsxs("div",{className:"hidden sm:flex sm:flex-1 sm:items-center sm:justify-between",children:[e.jsx("div",{children:e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Showing page ",e.jsx("span",{className:"font-semibold",children:s})," of ",e.jsx("span",{className:"font-semibold",children:n})]})}),e.jsx("div",{children:e.jsxs("nav",{className:"isolate inline-flex -space-x-px rounded-md shadow-sm","aria-label":"Pagination",children:[e.jsxs("button",{disabled:s===1,onClick:()=>r(s-1),className:"relative inline-flex items-center rounded-l-md px-2 py-2 text-muted-foreground ring-1 ring-inset ring-border hover:bg-secondary focus:z-20 focus:outline-offset-0 disabled:opacity-50",children:[e.jsx("span",{className:"sr-only",children:"Previous"}),e.jsx(c,{className:"h-4 w-4","aria-hidden":"true"})]}),o.map((i,d)=>e.jsxs("div",{className:"flex items-center",children:[d>0&&o[d-1]!==i-1&&e.jsx("span",{className:"relative inline-flex items-center px-4 py-2 text-sm font-semibold text-muted-foreground ring-1 ring-inset ring-border",children:"..."}),e.jsx("button",{onClick:()=>r(i),className:l("relative inline-flex items-center px-4 py-2 text-sm font-semibold focus:z-20 focus:outline-offset-0 ring-1 ring-inset ring-border",i===s?"gradient-primary text-primary-foreground":"text-foreground hover:bg-secondary"),children:i})]},i)),e.jsxs("button",{disabled:s===n,onClick:()=>r(s+1),className:"relative inline-flex items-center rounded-r-md px-2 py-2 text-muted-foreground ring-1 ring-inset ring-border hover:bg-secondary focus:z-20 focus:outline-offset-0 disabled:opacity-50",children:[e.jsx("span",{className:"sr-only",children:"Next"}),e.jsx(x,{className:"h-4 w-4","aria-hidden":"true"})]})]})})]})]})}export{u as P};
