All files / lib/CloseIcon index.js

100% Statements 6/6
66.67% Branches 2/3
50% Functions 1/2
100% Lines 6/6
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 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41                89x 3x   3x                       89x         89x                 89x      
import React from 'react';
import PropTypes from 'prop-types';
 
/**
 * @component CloseIcon
 * @variations collab-ui-react
 */
 
const CloseIcon = props => {
  const { className, onClick, ...otherHTMLProps } = props;
 
  return (
    <button
      className={
      `cui-close` +
      `${(className && ` ${className}`) || ''}`
      }
      onClick={onClick}
      {...otherHTMLProps}
    />
  );
};
 
CloseIcon.defaultProps = {
  onClick: () => {},
  className: '',
};
 
CloseIcon.propTypes = {
  /** @prop Handler when the user clicks the CloseIcon | () => {} */
  onClick: PropTypes.func,
 
  /** @prop Optional css class string | '' */
  className: PropTypes.string,
 
};
 
CloseIcon.displayName = 'CloseIcon';
 
export default CloseIcon;