Sha256: ddf67269d94d0f0f226e7f01ae6af95cdb634076aed98d3749ce1ab51567343b
Contents?: true
Size: 708 Bytes
Versions: 10
Compression:
Stored size: 708 Bytes
Contents
import React from 'react'; import { ListView } from 'patternfly-react'; import { Tooltip } from '@patternfly/react-core'; import PropTypes from 'prop-types'; const InfoItem = ({ itemId, children, tooltipText }) => { const overlay = ( <Tooltip content={tooltipText || ''} id={itemId}> {children} </Tooltip> ); return ( <ListView.InfoItem key={itemId} className="additional-info-wide"> {tooltipText ? overlay : children} </ListView.InfoItem> ); }; InfoItem.propTypes = { itemId: PropTypes.string.isRequired, children: PropTypes.node, tooltipText: PropTypes.string, }; InfoItem.defaultProps = { tooltipText: '', children: undefined, }; export default InfoItem;
Version data entries
10 entries across 10 versions & 1 rubygems