zent
Version:
一套前端设计语言和基于React的实现
15 lines (14 loc) • 1.1 kB
JavaScript
import { __assign } from "tslib";
import { jsx as _jsx } from "react/jsx-runtime";
import cx from 'classnames';
import useDelayed from './hooks/useDelayed';
import Icon from './components/icons';
export function InlineLoading(props) {
var _a = props.loading, loading = _a === void 0 ? false : _a, _b = props.delay, delay = _b === void 0 ? 0 : _b, className = props.className, _c = props.icon, icon = _c === void 0 ? 'circle' : _c, iconSize = props.iconSize, iconText = props.iconText, _d = props.textPosition, textPosition = _d === void 0 ? 'bottom' : _d, _e = props.colorPreset, colorPreset = _e === void 0 ? 'primary' : _e, textSize = props.textSize;
var delayed = useDelayed({ loading: loading, delay: delay });
if (delayed || !loading) {
return null;
}
return (_jsx("div", __assign({ className: cx('zent-loading', 'zent-loading--inline', className), "data-zv": '10.0.17' }, { children: _jsx(Icon, { icon: icon, size: iconSize, text: iconText, textPosition: textPosition, colorPreset: colorPreset, textSize: textSize }, void 0) }), void 0));
}
export default InlineLoading;