node-details-health-item.js 899 B

1234567891011121314151617181920212223242526272829
  1. import React from 'react';
  2. import Sparkline from '../sparkline';
  3. import { formatMetric } from '../../utils/string-utils';
  4. function NodeDetailsHealthItem(props) {
  5. const labelStyle = { color: props.labelColor };
  6. return (
  7. <div className="node-details-health-item">
  8. {!props.valueEmpty && <div className="node-details-health-item-value" style={labelStyle}>{formatMetric(props.value, props)}</div>}
  9. <div className="node-details-health-item-sparkline">
  10. <Sparkline
  11. data={props.samples}
  12. max={props.max}
  13. format={props.format}
  14. first={props.first}
  15. last={props.last}
  16. hoverColor={props.metricColor}
  17. hovered={props.hovered}
  18. />
  19. </div>
  20. <div className="node-details-health-item-label" style={labelStyle}>
  21. {props.label}
  22. </div>
  23. </div>
  24. );
  25. }
  26. export default NodeDetailsHealthItem;