brutal-legends/src/components/album.jsx
2019-04-24 09:58:02 +02:00

28 lines
767 B
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import React, { Component } from 'react';
export default class Album extends Component {
render() {
const {
id,
artist,
title,
songs,
year,
img,
purchased_on,
} = this.props;
const imagePath = `assets/covers/${img}`;
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>
)
}
}