All files / atom/input/src/Input/Wrappers/Button InputButton.js

100% Statements 5/5
100% Branches 2/2
100% Functions 1/1
100% Lines 5/5

Press n or j to go to the next uncovered block, b, p or k for the previous block.

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        1x 47x 43x     4x             1x                
import PropTypes from 'prop-types'
 
import {BASE_CLASS_BUTTON} from './config.js'
 
const InputButton = ({button, children}) => {
  if (button === undefined) {
    return children
  }
 
  return (
    <div className={BASE_CLASS_BUTTON}>
      <div className={`${BASE_CLASS_BUTTON}-input`}>{children}</div>
      <div className={`${BASE_CLASS_BUTTON}-button`}>{button}</div>
    </div>
  )
}
InputButton.propTypes = {
  /** button html element */
  button: PropTypes.node,
  /* inner react node element */
  children: PropTypes.node
}
 
export default InputButton