2018-11-21 14:47:30 +01:00
|
|
|
|
import React, { Component } from 'react';
|
|
|
|
|
|
|
|
|
|
|
|
export default class Album extends Component {
|
|
|
|
|
|
render() {
|
|
|
|
|
|
const {
|
|
|
|
|
|
id,
|
|
|
|
|
|
artist,
|
|
|
|
|
|
title,
|
|
|
|
|
|
songs,
|
|
|
|
|
|
year,
|
|
|
|
|
|
img,
|
|
|
|
|
|
purchased_on,
|
|
|
|
|
|
} = this.props;
|
2018-11-27 11:44:42 +01:00
|
|
|
|
const imagePath = `assets/covers/${img}`;
|
2018-11-21 14:47:30 +01:00
|
|
|
|
const song = songs.join(', ');
|
|
|
|
|
|
return (
|
|
|
|
|
|
<article>
|
|
|
|
|
|
<figure>
|
|
|
|
|
|
<img src={imagePath} alt="cover" />
|
|
|
|
|
|
</figure>
|
|
|
|
|
|
<span>
|
|
|
|
|
|
#{id+1}: {artist} - {song}, från "{title}" ({year})<br />
|
|
|
|
|
|
<small>✔️ {purchased_on}</small>
|
|
|
|
|
|
</span>
|
|
|
|
|
|
</article>
|
|
|
|
|
|
)
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|