"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const jsxRuntime = require("react/jsx-runtime");
const Pagination_context = require("../Pagination.context.cjs");
const PaginationControl = require("../PaginationControl/PaginationControl.cjs");
const PaginationDots = require("../PaginationDots/PaginationDots.cjs");
function PaginationItems({ dotsIcon }) {
  const ctx = Pagination_context.usePaginationContext();
  const items = ctx.range.map((page, index) => {
    var _a, _b, _c;
    if (page === "dots") {
      return /* @__PURE__ */ jsxRuntime.jsx(PaginationDots.PaginationDots, { icon: dotsIcon }, index);
    }
    return /* @__PURE__ */ jsxRuntime.jsx(
      PaginationControl.PaginationControl,
      {
        active: page === ctx.active,
        "aria-current": page === ctx.active ? "page" : void 0,
        onClick: () => ctx.onChange(page),
        disabled: ctx.disabled,
        ...(_a = ctx.getItemProps) == null ? void 0 : _a.call(ctx, page),
        children: ((_c = (_b = ctx.getItemProps) == null ? void 0 : _b.call(ctx, page)) == null ? void 0 : _c.children) ?? page
      },
      index
    );
  });
  return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: items });
}
PaginationItems.displayName = "@mantine/core/PaginationItems";
exports.PaginationItems = PaginationItems;
