UNPKG

@adaptabletools/adaptable

Version:

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

20 lines (19 loc) 1.54 kB
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime"; import * as React from 'react'; import { AdaptableObjectRow } from '../Components/AdaptableObjectRow'; import UIHelper from '../UIHelper'; import { cloneObject } from '../../Utilities/Helpers/Helper'; import join from '../../components/utils/join'; import { Box, Flex } from '../../components/Flex'; export class SystemStatusEntityRow extends React.Component { render() { let systemStatus = this.props .adaptableObject; let messageTypeColor = UIHelper.getColorByMessageType(systemStatus?.statusType ?? 'Success'); let colItems = cloneObject(this.props.colItems); colItems[0].Content = systemStatus ? (_jsxs("details", { children: [_jsxs(Flex, { title: systemStatus.statusFurtherInformation ? 'Click to see more' : '', className: join('ab-DashboardToolbar__SystemStatus__text', systemStatus.statusFurtherInformation && 'ab-DashboardToolbar__SystemStatus__text--expandable'), style: { backgroundColor: messageTypeColor }, alignItems: "center", as: "summary", children: [systemStatus.statusMessage, " ", systemStatus.statusFurtherInformation ? '...' : ''] }), systemStatus.statusFurtherInformation ? (_jsx(Box, { className: "ab-DashboardToolbar__SystemStatus__further-information twa:m-2", children: systemStatus.statusFurtherInformation })) : null] })) : null; colItems[1].Content = systemStatus.timestamp.toLocaleString(); return _jsx(AdaptableObjectRow, { colItems: colItems }); } }