UNPKG

@adaptabletools/adaptable

Version:

Powerful AG Grid extension which provides advanced, cutting-edge functionality to meet all DataGrid requirements

27 lines (26 loc) 1.45 kB
import { jsx as _jsx } from "react/jsx-runtime"; 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 (_jsx(Flex, { alignItems: "stretch", className: `ab-${elementType}__SystemStatus__wrap`, children: _jsx(Flex, { style: { color, backgroundColor: message ? background : '' }, className: `ab-${elementType}__SystemStatus__text twa:mr-2 twa:p-2 twa:text-2 twa:rounded-standard twa:min-h-input`, alignItems: "center", "data-name": "system-status-message", children: message || '0 Messages' }) })); } } function mapStateToProps(state) { return { SystemStatusMessageInfos: state.Internal.SystemStatusMessages, }; } function mapDispatchToProps(dispatch) { return {}; } export let SystemStatusViewPanel = connect(mapStateToProps, mapDispatchToProps)(SystemStatusViewPanelComponent);