All files / lib/TabHeader 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 36 37                    89x 3x   3x                 89x             89x       89x      
import React from 'react';
import PropTypes from 'prop-types';
 
/**
 * Tabheader is used for Large Tabs with subheadings;
 * @param props
 * @returns {XML}
 * @constructor
 */
 
const TabHeader = props => {
  const { heading, subHeading } = props;
 
  return (
    //Element type requires by UI-Collab Style
    <cui-tab-heading>
      {heading}
      {subHeading && <div>{subHeading}</div>}
    </cui-tab-heading>
  );
};
 
TabHeader.propTypes = {
  /** @prop TabHeader text */
  heading: PropTypes.string.isRequired,
  /** @prop Subheader text | '' */
  subHeading: PropTypes.string,
};
 
TabHeader.defaultProps = {
  subHeading: '',
};
 
TabHeader.displayName = 'TabHeader';
 
export default TabHeader;