2016-10-21 23:27:50 +13:00
|
|
|
|
|
|
|
|
import React, { PropTypes } from 'react'
|
|
|
|
|
import FontAwesome from 'react-fontawesome'
|
|
|
|
|
import { Link } from 'react-router'
|
|
|
|
|
|
|
|
|
|
import ListItem from './ListItem'
|
|
|
|
|
import ItemSource from './ItemSource'
|
|
|
|
|
|
|
|
|
|
export default class PlaylistListItem extends React.Component{
|
|
|
|
|
|
|
|
|
|
constructor(props) {
|
|
|
|
|
super(props);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
renderOwner(){
|
|
|
|
|
if( !this.props.item.owner ) return null;
|
|
|
|
|
return (
|
2016-12-21 15:24:07 +13:00
|
|
|
<Link to={global.baseURL+'user/'+this.props.item.owner.id}>
|
2016-10-21 23:27:50 +13:00
|
|
|
{ this.props.item.owner.id }
|
|
|
|
|
</Link>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
render(){
|
2016-11-08 13:36:13 +13:00
|
|
|
if( !this.props.item ) return null
|
|
|
|
|
|
2016-10-21 23:27:50 +13:00
|
|
|
return (
|
2016-12-21 15:24:07 +13:00
|
|
|
<ListItem extraClasses="playlist" link={global.baseURL+'playlist/'+this.props.item.uri}>
|
2016-10-21 23:27:50 +13:00
|
|
|
<span className="col name">
|
|
|
|
|
{this.props.item.name}
|
|
|
|
|
</span>
|
|
|
|
|
<span className="col owner">
|
|
|
|
|
{ this.renderOwner() }
|
|
|
|
|
</span>
|
|
|
|
|
<span className="col source">
|
|
|
|
|
<ItemSource uri={this.props.item.uri} />
|
|
|
|
|
</span>
|
|
|
|
|
</ListItem>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|