useColumnIcons.js 830 B

12345678910111213141516171819
  1. "use client";
  2. import * as React from 'react';
  3. import LeftOutlined from "@ant-design/icons/es/icons/LeftOutlined";
  4. import LoadingOutlined from "@ant-design/icons/es/icons/LoadingOutlined";
  5. import RightOutlined from "@ant-design/icons/es/icons/RightOutlined";
  6. const useColumnIcons = (prefixCls, rtl, expandIcon) => {
  7. let mergedExpandIcon = expandIcon;
  8. if (!expandIcon) {
  9. mergedExpandIcon = rtl ? /*#__PURE__*/React.createElement(LeftOutlined, null) : /*#__PURE__*/React.createElement(RightOutlined, null);
  10. }
  11. const loadingIcon = /*#__PURE__*/React.createElement("span", {
  12. className: `${prefixCls}-menu-item-loading-icon`
  13. }, /*#__PURE__*/React.createElement(LoadingOutlined, {
  14. spin: true
  15. }));
  16. return React.useMemo(() => [mergedExpandIcon, loadingIcon], [mergedExpandIcon]);
  17. };
  18. export default useColumnIcons;