import { j as a } from "../../../_virtual/jsx-runtime.js";
import { Ellipsis as f, PaginationButton as l } from "../styles.js";
import { getPageRangeList as j, getNumberOfPages as x } from "../utils.js";
import { getId as i } from "../../../utils/index.js";
const I = ({
  totalItems: o,
  rowsPerPage: s,
  currentPage: n,
  onChangePage: d,
  paginationLimiter: c = 3,
  ...e
}) => {
  const m = i(e["data-testid"]), g = i(e["data-trackid"]), p = x(o, s), u = j(
    n,
    p,
    c
  ).map((t, r) => t === -1 ? /* @__PURE__ */ a.jsx(f, { children: "..." }, r) : /* @__PURE__ */ a.jsx(
    l,
    {
      "data-active": n === t,
      onClick: () => d(t),
      "data-testid": m(`page-${t}`),
      "data-trackid": g(`page-${t}`),
      role: "button",
      children: t
    },
    r
  ));
  return /* @__PURE__ */ a.jsx(a.Fragment, { children: u });
};
export {
  I as default
};
