import React, { Component, PropTypes } from "react"; import CSSModules from "react-css-modules"; import { AlbumRow } from "./Album"; import css from "../styles/Artist.scss"; class ArtistCSS extends Component { render () { let albumsRows = []; if (this.props.artist.get("albums").size > 0) { const artistAlbums = this.props.albums; const artistSongs = this.props.songs; this.props.artist.get("albums").forEach(function (album) { album = artistAlbums.get(album); const songs = album.get("tracks").map( id => artistSongs.get(id) ); albumsRows.push(); }); } return (

{this.props.artist.get("name")}


{this.props.artist.get("summary")}

{this.props.artist.get("name")}/

{ albumsRows }
); } } // TODO: Not object ArtistCSS.propTypes = { artist: PropTypes.object.isRequired, albums: PropTypes.object.isRequired, songs: PropTypes.object.isRequired }; export default CSSModules(ArtistCSS, css);