renderEmpty.js
1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = void 0;
var React = _interopRequireWildcard(require("react"));
var _empty = _interopRequireDefault(require("../empty"));
var _ = require(".");
var renderEmpty = function renderEmpty(componentName) {
return /*#__PURE__*/React.createElement(_.ConfigConsumer, null, function (_ref) {
var getPrefixCls = _ref.getPrefixCls;
var prefix = getPrefixCls('empty');
switch (componentName) {
case 'Table':
case 'List':
return /*#__PURE__*/React.createElement(_empty["default"], {
image: _empty["default"].PRESENTED_IMAGE_SIMPLE
});
case 'Select':
case 'TreeSelect':
case 'Cascader':
case 'Transfer':
case 'Mentions':
return /*#__PURE__*/React.createElement(_empty["default"], {
image: _empty["default"].PRESENTED_IMAGE_SIMPLE,
className: "".concat(prefix, "-small")
});
default:
return /*#__PURE__*/React.createElement(_empty["default"], null);
}
});
};
var _default = renderEmpty;
exports["default"] = _default;