import{u as h,r as j,j as s}from"./index-gnHkq9KV.js";const v=[10,25,50,100,250];function f({pageNumber:t,pageSize:u,totalPages:i,totalRecords:l,totalMs:r,onPageChange:c,onPageSizeChange:x}){var p;const{t:a}=h(),[o,e]=j.useState(String(t)),g=n=>{e(n)},d=()=>{const n=parseInt(o,10);n>=1&&n<=i?c(n):e(String(t))},m=n=>{n.key==="Enter"&&d()};return String(t)!==o&&((p=document.activeElement)==null||p.classList.contains("page-input")),s.jsxs("div",{className:"pagination-bar",children:[s.jsxs("div",{className:"pagination-info",children:[s.jsx("span",{className:"pagination-records",children:a(l===1?"{{count}} record":"{{count}} records",{count:l.toLocaleString()})}),r!==void 0&&s.jsxs("span",{className:"pagination-timing",children:[r,"ms"]})]}),s.jsxs("div",{className:"pagination-controls",children:[s.jsx("button",{className:"btn btn-sm",disabled:t<=1,onClick:()=>{c(t-1),e(String(t-1))},children:a("Prev")}),s.jsxs("div",{className:"pagination-page",children:[s.jsx("input",{type:"number",className:"page-input",value:o,onChange:n=>g(n.target.value),onBlur:d,onKeyDown:m,min:1,max:i}),s.jsx("span",{children:a("of {{totalPages}}",{totalPages:i.toLocaleString()})})]}),s.jsx("button",{className:"btn btn-sm",disabled:t>=i,onClick:()=>{c(t+1),e(String(t+1))},children:a("Next")}),s.jsx("select",{className:"page-size-select",value:u,onChange:n=>x(parseInt(n.target.value,10)),children:v.map(n=>s.jsx("option",{value:n,children:a("{{size}} / page",{size:n.toLocaleString()})},n))})]})]})}export{f as P};
