2016-10-25 21:36:33 +13:00
|
|
|
|
|
|
|
|
import React, { PropTypes } from 'react'
|
|
|
|
|
import FontAwesome from 'react-fontawesome'
|
|
|
|
|
import { Link } from 'react-router'
|
|
|
|
|
|
|
|
|
|
export default class ArtistSentence extends React.Component{
|
|
|
|
|
|
|
|
|
|
constructor(props) {
|
|
|
|
|
super(props);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
render(){
|
|
|
|
|
return (
|
|
|
|
|
<span className="artist-sentence">
|
|
|
|
|
{
|
|
|
|
|
this.props.artists.map( (artist, index) => {
|
|
|
|
|
var separator = null;
|
|
|
|
|
if( index == this.props.artists.length - 2 ){
|
|
|
|
|
separator = ' and ';
|
|
|
|
|
}else if( index < this.props.artists.length - 2 ){
|
|
|
|
|
separator = ', ';
|
|
|
|
|
}
|
|
|
|
|
var link = '/artist/' + artist.uri;
|
|
|
|
|
return (
|
2016-11-07 18:09:42 +13:00
|
|
|
<span key={'index_'+artist.uri}>
|
2016-10-26 21:20:48 +13:00
|
|
|
<Link className="artist" to={ link }>{ artist.name }</Link>{ separator }
|
2016-10-25 21:36:33 +13:00
|
|
|
</span>
|
|
|
|
|
);
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
</span>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|