All files / lib/TabPane index.js

100% Statements 6/6
100% Branches 2/2
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                  89x 35x   35x             89x             89x         89x      
import React from 'react';
import PropTypes from 'prop-types';
 
/**
 * Tab is supplemental, non-clickable component used to help bring attention to an item or object.
 * @param props
 * @returns {XML}
 * @constructor
 */
const TabPane = props => {
  const { children, active } = props;
 
  return (
    <div className={`cui-tab__pane` + `${active ? ' active' : ''}`}>
      <div className="cui-tab__content">{children}</div>
    </div>
  );
};
 
TabPane.propTypes = {
  /** @prop Determines if TabPane is active | false */
  active: PropTypes.bool,
  /** @prop Children nodes to render inside TabPane | null */
  children: PropTypes.node,
};
 
TabPane.defaultProps = {
  active: false,
  children: null,
};
 
TabPane.displayName = 'TabPane';
 
export default TabPane;