import React from 'react'; export default class NodeResourcesMetricBoxInfo extends React.Component { humanizedMetricInfo() { const { humanizedTotalCapacity, humanizedAbsoluteConsumption, humanizedRelativeConsumption, showCapacity, format } = this.props.metricSummary.toJS(); const showExtendedInfo = showCapacity && format !== 'percent'; return ( {showExtendedInfo ? humanizedRelativeConsumption : humanizedAbsoluteConsumption} {' '} used {showExtendedInfo && ( {' - '} ( {humanizedAbsoluteConsumption} {' '} / {humanizedTotalCapacity} ) ) } ); } render() { const { width, x, y } = this.props; return (
{this.props.label} {this.humanizedMetricInfo()}
); } }