@fruits-chain/react-native-xiaoshu
Version:
React Native UI library
36 lines (34 loc) • 996 B
JavaScript
import React, { memo } from 'react';
import { useTheme, widthStyle } from '../theme';
import { isDef } from '../helpers';
import { ResultIconEmpty } from '../result/icons';
import Result from '../result';
import { createStyles } from './style';
/**
* Empty 空元素
* @description 用于填充空白数据。
*/
const Empty = _ref => {
let {
text = '暂无数据',
style,
textStyle,
iconStyle,
icon,
full = false
} = _ref;
const THEME_VAR = useTheme();
const STYLES = widthStyle(THEME_VAR, createStyles);
const iconJSX = isDef(icon) ? icon : /*#__PURE__*/React.createElement(ResultIconEmpty, {
style: [STYLES.icon, iconStyle]
});
return /*#__PURE__*/React.createElement(Result, {
status: "info",
renderIcon: () => iconJSX,
style: [STYLES.empty, full ? STYLES.emptyFull : null, style],
subtitle: text,
subtitleTextStyle: [STYLES.text, textStyle]
});
};
export default /*#__PURE__*/memo(Empty);
//# sourceMappingURL=index.js.map