import React from 'react';
import PublishDropzone from './PublishDropzone.jsx';
import PublishForm from './PublishForm.jsx';
import PublishStatus from './PublishStatus.jsx';
import {connect} from 'react-redux';

class PublishTool extends React.Component {
  constructor (props) {
    super(props);
  }
  render () {
    return (
      <div className="row row--tall flex-container--column">
        { !this.props.file && <PublishDropzone /> }
        { this.props.file && <PublishForm /> }
        { this.props.publishStatus && <PublishStatus /> }
      </div>
    );
  }
};

const mapStateToProps = state => {
  return {
    file         : state.file,
    publishStatus: state.publishStatus,
  };
};

export default connect(mapStateToProps, null)(PublishTool);
