1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 | import { __decorate, __extends } from "tslib";
|
17 | import classNames from "classnames";
|
18 | import * as React from "react";
|
19 | import { polyfill } from "react-lifecycles-compat";
|
20 | import { AbstractPureComponent2 } from "../../common";
|
21 | import * as Classes from "../../common/classes";
|
22 | import { DISPLAYNAME_PREFIX } from "../../common/props";
|
23 | import { ensureElement } from "../../common/utils";
|
24 | import { H4 } from "../html/html";
|
25 | import { Icon, IconSize } from "../icon/icon";
|
26 | var NonIdealState = (function (_super) {
|
27 | __extends(NonIdealState, _super);
|
28 | function NonIdealState() {
|
29 | return _super !== null && _super.apply(this, arguments) || this;
|
30 | }
|
31 | NonIdealState.prototype.render = function () {
|
32 | var _a = this.props, action = _a.action, children = _a.children, className = _a.className, description = _a.description, title = _a.title;
|
33 | return (React.createElement("div", { className: classNames(Classes.NON_IDEAL_STATE, className) },
|
34 | this.maybeRenderVisual(),
|
35 | title && React.createElement(H4, null, title),
|
36 | description && ensureElement(description, "div"),
|
37 | action,
|
38 | children));
|
39 | };
|
40 | NonIdealState.prototype.maybeRenderVisual = function () {
|
41 | var icon = this.props.icon;
|
42 | if (icon == null) {
|
43 | return null;
|
44 | }
|
45 | else {
|
46 | return (React.createElement("div", { className: Classes.NON_IDEAL_STATE_VISUAL },
|
47 | React.createElement(Icon, { icon: icon, size: IconSize.LARGE * 3 })));
|
48 | }
|
49 | };
|
50 | NonIdealState.displayName = DISPLAYNAME_PREFIX + ".NonIdealState";
|
51 | NonIdealState = __decorate([
|
52 | polyfill
|
53 | ], NonIdealState);
|
54 | return NonIdealState;
|
55 | }(AbstractPureComponent2));
|
56 | export { NonIdealState };
|
57 |
|
\ | No newline at end of file |