All files / javascripts/explorev2/components ControlLabelWithTooltip.jsx

77.78% Statements 7/9
0% Branches 0/2
0% Functions 0/1
77.78% Lines 7/9
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 271x 1x 1x   1x         1x                             1x 1x  
import React, { PropTypes } from 'react';
import { ControlLabel } from 'react-bootstrap';
import InfoTooltipWithTrigger from '../../components/InfoTooltipWithTrigger';
 
const propTypes = {
  label: PropTypes.string.isRequired,
  description: PropTypes.string,
};
 
const defaultProps = {
  description: null,
};
 
export default function ControlLabelWithTooltip({ label, description }) {
  return (
    <ControlLabel>
      {label} &nbsp;
      {description &&
        <InfoTooltipWithTrigger label={label} tooltip={description} />
      }
    </ControlLabel>
  );
}
 
ControlLabelWithTooltip.propTypes = propTypes;
ControlLabelWithTooltip.defaultProps = defaultProps;