"use strict";
const React = require("react");
const select = require("../Select/select.js");
const index = require("../ConfigProvider/index.js");
const emotionReactJsxRuntime_browser_esm = require("../../../../../../@emotion_react@11.10.4_3toe27fv7etiytxb5kxc7fxaw4/node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js");
var __assign = globalThis && globalThis.__assign || function() {
  __assign = Object.assign || function(t) {
    for (var s, i = 1, n = arguments.length; i < n; i++) {
      s = arguments[i];
      for (var p in s)
        if (Object.prototype.hasOwnProperty.call(s, p))
          t[p] = s[p];
    }
    return t;
  };
  return __assign.apply(this, arguments);
};
var noop = function() {
};
var Option = select.Option;
var _SizeOptions = [10, 20, 30, 40, 50];
function PageOption(props) {
  var selectRef = React.useRef();
  var locale = React.useContext(index.ConfigContext).locale;
  var _a = props.sizeCanChange, sizeCanChange = _a === void 0 ? false : _a, _b = props.onPageSizeChange, onPageSizeChange = _b === void 0 ? noop : _b, rootPrefixCls = props.rootPrefixCls, _c = props.sizeOptions, sizeOptions = _c === void 0 ? _SizeOptions : _c, _d = props.pageSize, pageSize = _d === void 0 ? 10 : _d, size = props.size, selectProps = props.selectProps, disabled = props.disabled;
  return sizeCanChange && /* @__PURE__ */ emotionReactJsxRuntime_browser_esm.jsx("div", {
    ref: selectRef,
    className: rootPrefixCls + "-option",
    "aria-label": locale.Pagination.pageSize,
    children: /* @__PURE__ */ emotionReactJsxRuntime_browser_esm.jsx(select, {
      ...__assign({
        value: sizeOptions.indexOf(pageSize) !== -1 ? pageSize : sizeOptions[0],
        onChange: function(value) {
          onPageSizeChange(value);
        },
        size,
        getPopupContainer: function() {
          return selectRef.current;
        },
        disabled
      }, selectProps),
      children: sizeOptions.map(function(num) {
        return /* @__PURE__ */ emotionReactJsxRuntime_browser_esm.jsx(Option, {
          value: num,
          children: num + " " + locale.Pagination.countPerPage
        }, num);
      })
    })
  });
}
module.exports = PageOption;
//# sourceMappingURL=page-options.js.map
