"use strict";
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 UIHelper_1 = tslib_1.__importDefault(require("../UIHelper"));
const Helper_1 = require("../../Utilities/Helpers/Helper");
const join_1 = tslib_1.__importDefault(require("../../components/utils/join"));
const Flex_1 = require("../../components/Flex");
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(Flex_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'), style: { backgroundColor: messageTypeColor }, alignItems: "center", as: "summary" },
                systemStatus.statusMessage,
                " ",
                systemStatus.statusFurtherInformation ? '...' : ''),
            systemStatus.statusFurtherInformation ? (React.createElement(Flex_1.Box, { className: "ab-DashboardToolbar__SystemStatus__further-information twa:m-2" }, systemStatus.statusFurtherInformation)) : null)) : null;
        colItems[1].Content = systemStatus.timestamp.toLocaleString();
        return React.createElement(AdaptableObjectRow_1.AdaptableObjectRow, { colItems: colItems });
    }
}
exports.SystemStatusEntityRow = SystemStatusEntityRow;
