import React from 'react'; import InfiniteScroll from 'react-infinite-scroller'; import {formatDuration} from './utils.js'; import logo from './logo.svg'; import './AlbumList.css'; function _albumProps(albums, index) { if (index === 0) { return {showArtist: true, showType: true} } if (albums[index-1].artist !== albums[index].artist) { return {showArtist: true, showType: true} } let showType = (albums[index-1].type !== albums[index].type); return {showType}; } function Album({album, showArtist, showType, onPlayAlbum}) { function onClick(album) { return (e) => { e.preventDefault() onPlayAlbum(album) } } return (