"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.SystemStatusStatusBarContent = void 0;
const tslib_1 = require("tslib");
const React = tslib_1.__importStar(require("react"));
const rebass_1 = require("rebass");
const AdaptableContext_1 = require("../AdaptableContext");
const getStatusItemStyle_1 = require("./Utilities/getStatusItemStyle");
const SystemStatusStatusBarContent = () => {
    const adaptable = (0, AdaptableContext_1.useAdaptable)();
    const currentSystemStatusMessageInfo = adaptable.api.systemStatusApi.getCurrentSystemStatusMessageInfo();
    const { color, background } = (0, getStatusItemStyle_1.getStatusItemStyle)(currentSystemStatusMessageInfo);
    const message = currentSystemStatusMessageInfo?.statusMessage;
    return (React.createElement(rebass_1.Box, { style: { borderRadius: 'var(--ab__border-radius)' }, padding: 1, color: message && color, backgroundColor: message && background }, message || '0 Messages'));
};
exports.SystemStatusStatusBarContent = SystemStatusStatusBarContent;
