{"size": 2002, "ext": "js", "max_stars_repo_path": "app/containers/VerificationContainer/index.js", "max_stars_repo_name": "venkatesh-soulpage/boozeboss-desktop", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "app/containers/VerificationContainer/index.js", "max_issues_repo_name": "venkatesh-soulpage/boozeboss-desktop", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "app/containers/VerificationContainer/index.js", "max_forks_repo_name": "venkatesh-soulpage/boozeboss-desktop", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 25.6666666667, "max_line_length": 143, "alphanum_fraction": 0.7017982018}
/**
 *
 * VerificationContainer
 *
 */

import React from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { Helmet } from 'react-helmet';
import { FormattedMessage } from 'react-intl';
import { createStructuredSelector } from 'reselect';
import { compose } from 'redux';

import injectSaga from 'utils/injectSaga';
import injectReducer from 'utils/injectReducer';
import makeSelectVerificationContainer, { makeSelectVerifications } from './selectors';
import reducer from './reducer';
import saga from './saga';
import messages from './messages';
import { VerificationSection } from './components';
import { getVerifications, updateVerificationStatus } from './actions';

/* eslint-disable react/prefer-stateless-function */
export class VerificationContainer extends React.PureComponent {

  componentWillMount = () => {
    const {getVerifications} = this.props;
    getVerifications();
  }

  render() {
    return (
      <div>
        <Helmet>
          <title>Users Verification</title>
          <meta
            name="description"
            content="Description of VerificationContainer"
          />
        </Helmet>
        <VerificationSection 
          {...this.props}
        />
      </div>
    );
  }
}

VerificationContainer.propTypes = {
  dispatch: PropTypes.func.isRequired,
};

const mapStateToProps = createStructuredSelector({
  verifications: makeSelectVerifications()
});

function mapDispatchToProps(dispatch) {
  return {
    getVerifications: () => dispatch(getVerifications()),
    updateVerificationStatus: (account_id, age_verification_status) => dispatch(updateVerificationStatus(account_id, age_verification_status)),
  };
}

const withConnect = connect(
  mapStateToProps,
  mapDispatchToProps,
);

const withReducer = injectReducer({ key: 'verification', reducer });
const withSaga = injectSaga({ key: 'verification', saga });

export default compose(
  withReducer,
  withSaga,
  withConnect,
)(VerificationContainer);
