import React, { PropTypes } from 'react'
import { connect } from 'react-redux'
import { Link } from 'react-router'
import { createStore, bindActionCreators } from 'redux'
import FontAwesome from 'react-fontawesome'
import * as pusherActions from '../services/pusher/actions'
class VersionManager extends React.Component{
constructor(props) {
super(props);
}
renderUpgradeButton(){
if( this.props.pusher.upgrading ){
return (
);
}
if( !this.props.pusher.version.is_root ){
return
}
if( this.props.pusher.version.upgrade_available ){
return
}
return
}
render(){
return (
{ this.renderUpgradeButton() }
{ this.props.pusher.version.current } installed
);
}
}
const mapStateToProps = (state, ownProps) => {
return state;
}
const mapDispatchToProps = (dispatch) => {
return {
pusherActions: bindActionCreators(pusherActions, dispatch)
}
}
export default connect(mapStateToProps, mapDispatchToProps)(VersionManager)