Sha256: d80fa9c77a70a75bdab1dbe2fc07d08c0c59157aa8f1d4f6b11995116e335782
Contents?: true
Size: 868 Bytes
Versions: 22
Compression:
Stored size: 868 Bytes
Contents
import React from 'react'; import { ListView } from 'patternfly-react'; import PropTypes from 'prop-types'; import { itemIteratorId } from './helpers'; const wrapWithLink = (template, editPath) => { if (template.id && template.canEdit) { return ( <a href={editPath.replace(':id', template.id)} target="_blank" rel="noopener noreferrer" > {template.name} </a> ); } return template.name || ' '; }; const LinkInfoItem = ({ template, editPath, attr }) => ( <ListView.InfoItem key={itemIteratorId(template, attr)} className="additional-info-wide" > {wrapWithLink(template, editPath)} </ListView.InfoItem> ); LinkInfoItem.propTypes = { template: PropTypes.object.isRequired, editPath: PropTypes.string.isRequired, attr: PropTypes.string.isRequired, }; export default LinkInfoItem;
Version data entries
22 entries across 22 versions & 1 rubygems