All files / lib/FormInfo 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              89x 7x   7x               89x             89x         89x      
import React from 'react';
import PropTypes from 'prop-types';
 
/**
 * FormInfo is supplemental, organizational component used to help divide form
 **/
 
const FormInfo = props => {
  const { title, description } = props;
 
  return (
    <div className="section__info">
      <h4 className="section__title">{title}</h4>
      {description && <p className="section__description">{description}</p>}
    </div>
  );
};
 
FormInfo.propTypes = {
  /** @prop Optional FormInfo description text | '' */
  description: PropTypes.string,
  /** @prop Optional FormInfo title | '' */
  title: PropTypes.string
};
 
FormInfo.defaultProps = {
  description: '',
  title: ''
};
 
FormInfo.displayName = 'FormInfo';
 
export default FormInfo;