import * as React from 'react';
import { connect } from 'react-redux';
import { getStatusItemStyle } from './Utilities/getStatusItemStyle';
import { Flex } from '../../components/Flex';
class SystemStatusViewPanelComponent extends React.Component {
    constructor(props) {
        super(props);
    }
    render() {
        const currentSystemStatusMessageInfo = this.props.api.systemStatusApi.getCurrentSystemStatusMessageInfo();
        const { color, background } = getStatusItemStyle(currentSystemStatusMessageInfo);
        const message = currentSystemStatusMessageInfo?.statusMessage;
        const elementType = this.props.viewType === 'Toolbar' ? 'DashboardToolbar' : 'ToolPanel';
        return (React.createElement(Flex, { alignItems: "stretch", className: `ab-${elementType}__SystemStatus__wrap` },
            React.createElement(Flex, { style: { color, backgroundColor: message ? background : '' }, className: `ab-${elementType}__SystemStatus__text twa:mr-2 twa:p-2 twa:text-2 twa:rounded-standard`, alignItems: "center", "data-name": "system-status-message" }, message || '0 Messages')));
    }
}
function mapStateToProps(state) {
    return {
        SystemStatusMessageInfos: state.Internal.SystemStatusMessages,
    };
}
function mapDispatchToProps(dispatch) {
    return {};
}
export let SystemStatusViewPanel = connect(mapStateToProps, mapDispatchToProps)(SystemStatusViewPanelComponent);
