import { useContext } from "react";
import IconLeft from "../../icon/react-icon/IconLeft/index.js";
import IconRight from "../../icon/react-icon/IconRight/index.js";
import { ConfigContext } from "../ConfigProvider/index.js";
import cs from "../_util/classNames.js";
import { jsxs, jsx } from "../../../../../../@emotion_react@11.10.4_3toe27fv7etiytxb5kxc7fxaw4/node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js";
function ImagePreviewArrow(props) {
  var _a, _b;
  var current = props.current, previewCount = props.previewCount, _c = props.infinite, infinite = _c === void 0 ? false : _c, onPrev = props.onPrev, onNext = props.onNext;
  var getPrefixCls = useContext(ConfigContext).getPrefixCls;
  var prefixCls = getPrefixCls("image-preview");
  var classNames = cs(prefixCls + "-arrow");
  var disableLeft = !infinite && current <= 0;
  var disableRight = !infinite && current >= previewCount - 1;
  return /* @__PURE__ */ jsxs("div", {
    className: classNames,
    children: [/* @__PURE__ */ jsx("div", {
      className: cs(prefixCls + "-arrow-left", (_a = {}, _a[prefixCls + "-arrow-disabled"] = disableLeft, _a)),
      onClick: function(e) {
        e.preventDefault();
        !disableLeft && onPrev && onPrev();
      },
      children: /* @__PURE__ */ jsx(IconLeft, {})
    }), /* @__PURE__ */ jsx("div", {
      className: cs(prefixCls + "-arrow-right", (_b = {}, _b[prefixCls + "-arrow-disabled"] = disableRight, _b)),
      onClick: function(e) {
        e.preventDefault();
        !disableRight && onNext && onNext();
      },
      children: /* @__PURE__ */ jsx(IconRight, {})
    })]
  });
}
export {
  ImagePreviewArrow as default
};
//# sourceMappingURL=image-preview-arrow.js.map
