import React, { forwardRef } from 'react'; import LoadingOutlined from '@ant-design/icons/LoadingOutlined'; import classNames from 'classnames'; import CSSMotion from 'rc-motion'; import IconWrapper from './IconWrapper'; type InnerLoadingIconProps = { prefixCls: string; className?: string; style?: React.CSSProperties; iconClassName?: string; }; const InnerLoadingIcon = forwardRef( ({ prefixCls, className, style, iconClassName }, ref) => { const mergedIconCls = classNames(`${prefixCls}-loading-icon`, className); return ( ); }, ); export interface LoadingIconProps { prefixCls: string; existIcon: boolean; loading?: boolean | object; className?: string; style?: React.CSSProperties; } const getCollapsedWidth = (): React.CSSProperties => ({ width: 0, opacity: 0, transform: 'scale(0)', }); const getRealWidth = (node: HTMLElement): React.CSSProperties => ({ width: node.scrollWidth, opacity: 1, transform: 'scale(1)', }); const LoadingIcon: React.FC = (props) => { const { prefixCls, loading, existIcon, className, style } = props; const visible = !!loading; if (existIcon) { return ; } return ( {({ className: motionCls, style: motionStyle }, ref: React.Ref) => ( )} ); }; export default LoadingIcon;