@blueprintjs/core
Version:
Core styles & components
35 lines • 1.38 kB
JavaScript
/*
* Copyright 2016 Palantir Technologies, Inc. All rights reserved.
*
* Licensed under the terms of the LICENSE file distributed with this project.
*/
import classNames from "classnames";
import * as React from "react";
import * as Classes from "../../common/classes";
import { DISPLAYNAME_PREFIX } from "../../common/props";
import { ensureElement } from "../../common/utils";
import { H4 } from "../html/html";
import { Icon } from "../icon/icon";
export class NonIdealState extends React.PureComponent {
render() {
const { action, children, className, description, title } = this.props;
return (React.createElement("div", { className: classNames(Classes.NON_IDEAL_STATE, className) },
this.maybeRenderVisual(),
title && React.createElement(H4, null, title),
description && ensureElement(description, "div"),
action,
children));
}
maybeRenderVisual() {
const { icon } = this.props;
if (icon == null) {
return null;
}
else {
return (React.createElement("div", { className: Classes.NON_IDEAL_STATE_VISUAL },
React.createElement(Icon, { icon: icon, iconSize: Icon.SIZE_LARGE * 3 })));
}
}
}
NonIdealState.displayName = `${DISPLAYNAME_PREFIX}.NonIdealState`;
//# sourceMappingURL=nonIdealState.js.map