import React from "react"; import classNames from "classnames"; import { Icon } from "../icon"; import { useTranslation } from "../i18n"; import { StyledProps } from "../_type"; import { useConfig } from "../_util/config-context"; export interface LoadingTipProps extends StyledProps { /** * 加载文案 * @default "加载中..." */ loadingText?: React.ReactNode; /** * 隐藏图标 * @default false */ hideIcon?: boolean; } export const LoadingTip = React.forwardRef(function LoadingTip( props: LoadingTipProps, ref: React.Ref ) { const { classPrefix } = useConfig(); const t = useTranslation(); const { hideIcon, className, loadingText = t.loadingText, ...restProps } = props; return ( {!hideIcon && } {typeof loadingText === "string" ? ( {loadingText} ) : ( loadingText )} ); }); LoadingTip.displayName = "LoadingTip";