{"size": 887, "ext": "js", "max_stars_repo_path": "app/containers/setup/boundaries/index.js", "max_stars_repo_name": "forest-watcher/forest-watcher", "max_stars_repo_stars_event_min_datetime": "2019-02-19T09:47:21.000Z", "max_stars_repo_stars_event_max_datetime": "2022-01-12T07:53:01.000Z", "max_issues_repo_path": "app/containers/setup/boundaries/index.js", "max_issues_repo_name": "forest-watcher/forest-watcher", "max_issues_repo_issues_event_min_datetime": "2020-09-04T06:21:50.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-01T22:55:14.000Z", "max_forks_repo_path": "app/containers/setup/boundaries/index.js", "max_forks_repo_name": "forest-watcher/forest-watcher", "max_forks_repo_forks_event_min_datetime": "2019-02-11T11:05:36.000Z", "max_forks_repo_forks_event_max_datetime": "2020-12-28T14:39:35.000Z"}
{"max_stars_count": 12, "max_issues_count": 13, "max_forks_count": 3, "avg_line_length": 25.3428571429, "max_line_length": 95, "alphanum_fraction": 0.7305524239}
// @flow
import type { ComponentProps, Dispatch, State } from 'types/store.types';

import { bindActionCreators } from 'redux';
import { connect } from 'react-redux';
import { setSetupArea } from 'redux-modules/setup';

import SetupBoundaries from 'components/setup/boundaries';

type OwnProps = {|
  +componentId: string
|};

function mapStateToProps(state: State) {
  const coordinates = state.setup.area.geojson ? state.setup.area.geojson.coordinates[0] : [];
  return {
    coordinates,
    setupCountry: state.setup.country
  };
}

const mapDispatchToProps = (dispatch: Dispatch) =>
  bindActionCreators(
    {
      setSetupArea
    },
    dispatch
  );

type PassedProps = ComponentProps<OwnProps, typeof mapStateToProps, typeof mapDispatchToProps>;
export default connect<PassedProps, OwnProps, _, _, State, Dispatch>(
  mapStateToProps,
  mapDispatchToProps
)(SetupBoundaries);
