text: import e,{useCallback as b,useEffect as E,useState as f}from"../../web_modules/react.js";import{em as a}from"../utils/style.js";import u from"./Button.js";import g from"./Input.js";import j from"../../web_modules/styled-components.js";import{useTranslation as v}from"../../web_modules/react-i18next.js";const w=j.nav.withConfig({displayName:"Pagination__Wrapper",componentId:"sc-1qc3w8i-0"})(["display:flex;justify-content:space-between;align-items:center;> div{> a:not(:last-child),> span{margin-right:",";}> input{width:",";margin-right:",";}}"],a(15),a(80),a(6)),P=({page:t,total:m,className:y,onChange:i})=>{const{t:s}=v("common"),[o,p]=f(t!=null?t:1),[l,d]=f("");E(()=>p(t!=null?t:1),[t]);const c=b(n=>{const r=typeof n=="number"?n:Number.parseInt(n+"");Number.isNaN(r)||r>m||r<1||r===o||(p(r),d(""),i==null||i(r))},[o,i,m]);return e.createElement(w,{className:y},e.createElement("div",null,e.createElement(u,{disabled:o<=1,onClick:()=>c(o-1)},s("common:previous-page")),e.createElement(u,{disabled:o>=m,onClick:()=>c(o+1)},s("common:next-page"))),e.createElement("div",null,e.createElement("span",null,s("common:total-page",{count:m})),e.createElement(g,{value:l,onChange:n=>d(n),onKeyDown:n=>n.key==="Enter"&&c(l)}),e.createElement(u,{onClick:()=>c(l),type:"primary"},s("common:confirm"))))};export default P;
  