import { j as t } from "../../../_virtual/jsx-runtime.js";
import { useMemo as x } from "react";
import { Dropdown as b } from "../../Field/dropdown/Dropdown.js";
import { PaginationText as s } from "../styles.js";
import { getNumberOfPages as j } from "../utils.js";
import { getId as p } from "../../../utils/index.js";
const O = ({
  totalItems: d,
  rowsPerPage: m,
  narrowPaginationText: o = {
    indicator: "Page",
    preposition: "of"
  },
  currentPage: r,
  onChangePage: l,
  ...e
}) => {
  const u = p(e["data-testid"]), c = p(e["data-trackid"]), a = j(d, m), g = x(
    () => Array(a).fill(null).map((i, f) => {
      const n = f + 1;
      return {
        value: n,
        label: n.toString()
      };
    }),
    [a]
  );
  return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
    /* @__PURE__ */ t.jsx(s, { children: o.indicator }),
    /* @__PURE__ */ t.jsx(
      b,
      {
        variant: "small",
        options: g,
        onChange: (i) => l(Number(i.value)),
        value: { value: r, label: r.toString() },
        noMargin: !0,
        width: "82px",
        "data-testid": u(),
        "data-trackid": c()
      }
    ),
    /* @__PURE__ */ t.jsxs(s, { children: [
      o.preposition,
      " ",
      a
    ] })
  ] });
};
export {
  O as default
};
