import { j as s } from "../../node_modules/react/jsx-runtime.mjs";
import { useState as l } from "react";
import { isMobile as C } from "../../node_modules/react-device-detect/dist/lib.mjs";
import "./index.less.mjs";
import P from "../../node_modules/antd/es/pagination/Pagination.mjs";
let o = !0;
const k = ({
  pageSizeOptions: m = [10, 20, 50, 100],
  total: g = 0,
  dataSource: i = [],
  formPage: u,
  paginationEmit: n = () => {
  },
  direction: h = "end",
  totalText: f = "共",
  totalItemText: p = "条数据"
}) => {
  const [r, a] = l(u || 1), [c, j] = l(10), x = (e, t) => {
    a(e), o && n(e, t);
  }, z = (e, t) => {
    o = !1, j(t), setTimeout(() => {
      a(1), n(1, t), setTimeout(() => {
        o = !0;
      }, 100);
    }, 100);
  };
  return /* @__PURE__ */ s.jsx(s.Fragment, { children: (i == null ? void 0 : i.length) != 0 && !C && /* @__PURE__ */ s.jsx("div", { className: "bitzPaginationBlock", style: { justifyContent: h }, children: /* @__PURE__ */ s.jsx(
    P,
    {
      size: "small",
      total: g,
      defaultCurrent: r,
      current: r,
      pageSize: c,
      showSizeChanger: !0,
      showQuickJumper: !0,
      pageSizeOptions: m,
      showTotal: (e) => `${f} ${e} ${p}`,
      onChange: x,
      onShowSizeChange: z
    }
  ) }) });
};
export {
  k as default
};
