import React, { Component } from 'react'
import { bindActionCreators } from 'redux'
import { connect } from 'react-redux'
import { Link } from 'react-router-dom'
import * as actions from '../actions'
import { TableObject } from '../common'
class PaperCitations extends Component {
render() {
const { dataset, citations } = this.props.api.paperInfo
if (!dataset || !citations) return null
console.log('rendering citations...')
return (
{dataset.name_full}: Citations
{citations.map((citation, i) => {
let cite = { ...citation }
cite.id = {
_raw: true,
value: {citation.id}
}
cite.pdf = {
_raw: true,
value: cite.pdf ? [pdf] : "no pdf"
}
cite.addresses = {
_raw: true,
value: cite.addresses.map((address, j) => (
{address.address}{', '}{address.type}
))
}
return (
-
)
})}
)
}
}
const mapStateToProps = state => ({
api: state.api
})
const mapDispatchToProps = dispatch => ({
actions: bindActionCreators({ ...actions }, dispatch),
})
export default connect(mapStateToProps, mapDispatchToProps)(PaperCitations)