import React, { memo } from 'react'; import URILink from './URILink'; export default memo((props) => { if (!props.items) { return -; } return ( { props.items.map((item, index) => { if (!item) { return -; } let separator = null; if (index == props.items.length - 2) { separator = ' and '; } else if (index < props.items.length - 2) { separator = ', '; } if (!item.name) { var content = -; } else if (!item.uri || props.nolinks) { var content = { item.name }; } else { var content = { item.name }; } return ( { content } { separator } ); }) } ); });