operation.js 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. "use client";
  2. import * as React from 'react';
  3. import LeftOutlined from "@ant-design/icons/es/icons/LeftOutlined";
  4. import RightOutlined from "@ant-design/icons/es/icons/RightOutlined";
  5. import Button from '../button';
  6. const Operation = props => {
  7. const {
  8. disabled,
  9. moveToLeft,
  10. moveToRight,
  11. leftArrowText = '',
  12. rightArrowText = '',
  13. leftActive,
  14. rightActive,
  15. className,
  16. style,
  17. direction,
  18. oneWay
  19. } = props;
  20. return /*#__PURE__*/React.createElement("div", {
  21. className: className,
  22. style: style
  23. }, /*#__PURE__*/React.createElement(Button, {
  24. type: "primary",
  25. size: "small",
  26. disabled: disabled || !rightActive,
  27. onClick: moveToRight,
  28. icon: direction !== 'rtl' ? /*#__PURE__*/React.createElement(RightOutlined, null) : /*#__PURE__*/React.createElement(LeftOutlined, null)
  29. }, rightArrowText), !oneWay && (/*#__PURE__*/React.createElement(Button, {
  30. type: "primary",
  31. size: "small",
  32. disabled: disabled || !leftActive,
  33. onClick: moveToLeft,
  34. icon: direction !== 'rtl' ? /*#__PURE__*/React.createElement(LeftOutlined, null) : /*#__PURE__*/React.createElement(RightOutlined, null)
  35. }, leftArrowText)));
  36. };
  37. if (process.env.NODE_ENV !== 'production') {
  38. Operation.displayName = 'Operation';
  39. }
  40. export default Operation;