import React, { Component } from 'react'
import { bindActionCreators } from 'redux'
import { connect } from 'react-redux'
import * as actions from '../actions'
import { Loader } from '../common'
class PaperManager extends Component {
componentDidMount() {
this.props.actions.getPaperInfo(this.props.match.params.key)
}
componentDidUpdate(oldProps) {
if (this.props.match.params.key !== oldProps.match.params.key) {
this.props.actions.getPaperInfo(this.props.match.params.key)
}
}
render() {
if (!this.props.match.params.key) return null
if (this.props.api.paperInfo.loading) return