import React, { Component, PropTypes } from "react"; import CSSModules from "react-css-modules"; import { formatLength } from "../utils"; import css from "../styles/Album.scss"; export class AlbumTrackRow extends Component { render () { const length = formatLength(this.props.track.length); return ( {this.props.track.track} {this.props.track.name} {length} ); } } AlbumTrackRow.propTypes = { track: PropTypes.object.isRequired }; export class AlbumTracksTable extends Component { render () { var rows = []; this.props.tracks.forEach(function (item) { rows.push(); }); return ( {rows}
); } } AlbumTracksTable.propTypes = { tracks: PropTypes.array.isRequired }; class AlbumRowCSS extends Component { render () { return (

{this.props.album.name}

{this.props.album.name}

{ Array.isArray(this.props.album.tracks) ? : null }
); } } AlbumRowCSS.propTypes = { album: PropTypes.object.isRequired }; export let AlbumRow = CSSModules(AlbumRowCSS, css); export default class Album extends Component { render () { return ( ); } } Album.propTypes = { album: PropTypes.object.isRequired };