import React from 'react'; import PropTypes from 'prop-types'; import './index.scss'; const Label = (props) => { const { label, required, htmlFor, } = props; if (label) { return ( ); } return null; }; Label.defaultProps = { required: false, label: '', }; Label.propTypes = { label: PropTypes.oneOfType([ PropTypes.string, PropTypes.node, ]), htmlFor: PropTypes.string.isRequired, required: PropTypes.bool, }; export default Label;