All files / lib/ListItemSection index.js

100% Statements 6/6
100% Branches 3/3
100% Functions 1/1
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 42 43 44 45 46                  89x         508x   508x                       89x                 89x           89x    
/**
* @category containers
* @component list-item
* @variations collab-ui-react
*/
 
import React from 'react';
import PropTypes from 'prop-types';
 
const ListItemSection = props => {
    const {
      children,
      className,
      position,
    } = props;
 
  return (
    <div
      className={
        `cui-list-item__${position}` +
        `${(className && ` ${className}`) || ''}`
      }
    >
      {children}
    </div>
  );
};
 
ListItemSection.propTypes = {
  /** @prop Children nodes to render inside ListItemSection | null */
  children: PropTypes.node,
  /** @prop Optional css class name | '' */
  className: PropTypes.string,
  /** @prop Determine the ListItemSection's position | 'center' */
  position: PropTypes.oneOf(['left', 'center', 'right', 'center-align']),
};
 
ListItemSection.defaultProps = {
  children: null,
  className: '',
  position: 'center',
};
 
ListItemSection.displayName = 'ListItemSection';
 
export default ListItemSection;