@fruits-chain/react-native-xiaoshu
Version:
🌈 React Native UI library
45 lines (43 loc) • 1.17 kB
JavaScript
import isUndefined from 'lodash/isUndefined';
import React, { memo } from 'react';
import Locale from "../locale/index.js";
import Result from "../result/index.js";
import ResultIconEmpty from "../result/icons/result-icon-empty.js";
import Theme from "../theme/index.js";
import { varCreator, styleCreator } from "./style.js";
/**
* Empty 空元素
* @description 用于填充空白数据。
*/
import { jsx as _jsx } from "react/jsx-runtime";
const Empty = ({
testID,
theme,
text,
style,
textStyle,
iconStyle,
icon,
full = false
}) => {
const locale = Locale.useLocale().Empty;
const [, STYLES] = Theme.useStyle({
varCreator,
styleCreator,
theme
});
const iconJSX = !isUndefined(icon) ? icon : /*#__PURE__*/_jsx(ResultIconEmpty, {
style: [STYLES.icon, iconStyle]
});
return /*#__PURE__*/_jsx(Result, {
testID: testID,
status: "info",
renderIcon: () => iconJSX,
style: [STYLES.empty, full ? STYLES.emptyFull : null, style],
subtitle: text ?? locale.text,
subtitleTextStyle: [STYLES.text, textStyle]
});
};
export default /*#__PURE__*/memo(Empty);
//# sourceMappingURL=empty.js.map
;