import React, { memo } from 'react'; import Thumbnail from './Thumbnail'; import URILink from './URILink'; export default memo(({ artists, uiActions: { showContextMenu } = {} }) => { if (!artists) return null; const onContextMenu = (e, item) => { if (showContextMenu){ e.preventDefault(); showContextMenu({ e, context: 'artist', uris: [item.uri], items: [item], }); } }; return (
{artists.map((artist) => { let { images } = artist; if (Array.isArray(images)) { images = images[0]; } if (artist.uri) { return ( onContextMenu(e, artist)} > { artist.name } ); } return ( { artist.name } ); })}
); });