import React from 'react'; import cx from 'classnames'; import Wrap from './Wrap'; import bem from '../utils/bem'; const b = bem('rdf-loading'); export interface LoadingProps extends React.SVGAttributes { color?: string; colorType?: 'default' | 'primary' | 'success' | 'warning' | 'error'; size?: string | number; label?: React.ReactNode; vertical?: boolean; className?: string; style?: React.CSSProperties; } interface LoadingComponent extends React.FC { Wrap: typeof Wrap; } export const Loading: LoadingComponent = props => { const { color = 'currentColor', colorType = 'default', size = '1em', label, vertical = false, className, style, ...restProps } = props; const cls = cx(b(''), className, { [b('', colorType)]: colorType !== 'default', [b('', 'vertical')]: vertical, }); return (
{label && {label}}
); }; Loading.Wrap = Wrap; export default Loading;