import{n as j,u as f,j as i,S as b,f as g,g as N,h as C,i as k,B as r,c as y}from"./index-DXI13nSQ.js";import{C as S}from"./chevron-left-BtuaBNRZ.js";import{C as z}from"./chevron-right-uDVVnuGu.js";/**
 * @license lucide-react v0.469.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const L=j("ChevronFirst",[["path",{d:"m17 18-6-6 6-6",key:"1yerx2"}],["path",{d:"M7 6v12",key:"1p53r6"}]]);/**
 * @license lucide-react v0.469.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const M=j("ChevronLast",[["path",{d:"m7 18 6-6-6-6",key:"lwmzdw"}],["path",{d:"M17 6v12",key:"1o0aio"}]]);function T({page:e,totalPages:c,totalRows:n,perPage:s,perPageOptions:o,onPageChange:l,onPerPageChange:d,className:u}){const{t:a}=f("common"),x=e>1,m=e<c,p=s!==void 0&&o&&o.length>0&&d,h=s?(e-1)*s+1:null,v=s&&n!==void 0?Math.min(e*s,n):null;return i.jsxs("div",{className:y("flex flex-wrap items-center justify-between gap-3 py-2",u),role:"navigation","aria-label":a("pagination.label"),children:[i.jsxs("div",{className:"flex items-center gap-2 text-sm text-text-dim",children:[p&&i.jsxs("div",{className:"hidden sm:flex items-center gap-2",children:[i.jsx("span",{children:a("pagination.perPage")}),i.jsxs(b,{value:String(s),onValueChange:t=>d?.(Number(t)),children:[i.jsx(g,{className:"h-8 w-[80px]",children:i.jsx(N,{})}),i.jsx(C,{children:o.map(t=>i.jsx(k,{value:String(t),children:t},t))})]})]}),n!==void 0&&h!==null&&v!==null&&i.jsx("span",{"aria-live":"polite",children:a("pagination.range",{from:n===0?0:h,to:v,total:n})})]}),i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsx(r,{variant:"ghost",size:"icon","aria-label":a("pagination.firstPage"),disabled:!x,onClick:()=>l(1),className:"hidden sm:inline-flex",children:i.jsx(L,{})}),i.jsx(r,{variant:"ghost",size:"icon","aria-label":a("actions.previous"),disabled:!x,onClick:()=>l(e-1),children:i.jsx(S,{})}),i.jsx("span",{className:"px-2 text-sm tabular-nums","aria-live":"polite",children:a("pagination.pageOfTotal",{page:e,totalPages:Math.max(1,c)})}),i.jsx(r,{variant:"ghost",size:"icon","aria-label":a("actions.next"),disabled:!m,onClick:()=>l(e+1),children:i.jsx(z,{})}),i.jsx(r,{variant:"ghost",size:"icon","aria-label":a("pagination.lastPage"),disabled:!m,onClick:()=>l(c),className:"hidden sm:inline-flex",children:i.jsx(M,{})})]})]})}T.displayName="Pagination";export{T as P};
//# sourceMappingURL=pagination-dm3r6K_2.js.map
