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
};
class AlbumTracksTableCSS extends Component {
render () {
var rows = [];
this.props.tracks.forEach(function (item) {
rows.push();
});
return (
);
}
}
AlbumTracksTableCSS.propTypes = {
tracks: PropTypes.array.isRequired
};
export let AlbumTracksTable = CSSModules(AlbumTracksTableCSS, css);
class AlbumRowCSS extends Component {
render () {
return (
{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
};