@adaptabletools/adaptable-cjs
Version:
Powerful data-agnostic HTML5 AG Grid extension which provides advanced, cutting-edge functionality to meet all DataGrid requirements
29 lines (28 loc) • 1.91 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.SystemStatusEntityRow = void 0;
const tslib_1 = require("tslib");
const React = tslib_1.__importStar(require("react"));
const AdaptableObjectRow_1 = require("../Components/AdaptableObjectRow");
const rebass_1 = require("rebass");
const UIHelper_1 = tslib_1.__importDefault(require("../UIHelper"));
const Helper_1 = require("../../Utilities/Helpers/Helper");
const join_1 = tslib_1.__importDefault(require("../../components/utils/join"));
class SystemStatusEntityRow extends React.Component {
render() {
let systemStatus = this.props
.adaptableObject;
let messageTypeColor = UIHelper_1.default.getColorByMessageType(systemStatus?.statusType ?? 'Success');
let colItems = (0, Helper_1.cloneObject)(this.props.colItems);
colItems[0].Content = systemStatus ? (React.createElement("details", null,
React.createElement(rebass_1.Flex, { title: systemStatus.statusFurtherInformation ? 'Click to see more' : '', className: (0, join_1.default)('ab-DashboardToolbar__SystemStatus__text', systemStatus.statusFurtherInformation &&
'ab-DashboardToolbar__SystemStatus__text--expandable'), backgroundColor: messageTypeColor, alignItems: "center", as: "summary" },
systemStatus.statusMessage,
" ",
systemStatus.statusFurtherInformation ? '...' : ''),
systemStatus.statusFurtherInformation ? (React.createElement(rebass_1.Box, { className: "ab-DashboardToolbar__SystemStatus__further-information", margin: 2 }, systemStatus.statusFurtherInformation)) : null)) : null;
colItems[1].Content = systemStatus.timestamp.toLocaleString();
return React.createElement(AdaptableObjectRow_1.AdaptableObjectRow, { colItems: colItems });
}
}
exports.SystemStatusEntityRow = SystemStatusEntityRow;