{"size": 1357, "ext": "js", "max_stars_repo_path": "pcs/webui/src/components/pages/packages/flyouts/packageNew/packageNew.container.js", "max_stars_repo_name": "colawwj/AI-Video-Intelligence-Solution-Accelerator", "max_stars_repo_stars_event_min_datetime": "2017-10-10T01:06:58.000Z", "max_stars_repo_stars_event_max_datetime": "2021-11-11T17:52:45.000Z", "max_issues_repo_path": "pcs/webui/src/components/pages/packages/flyouts/packageNew/packageNew.container.js", "max_issues_repo_name": "colawwj/AI-Video-Intelligence-Solution-Accelerator", "max_issues_repo_issues_event_min_datetime": "2017-10-03T06:34:12.000Z", "max_issues_repo_issues_event_max_datetime": "2020-12-10T21:37:34.000Z", "max_forks_repo_path": "pcs/webui/src/components/pages/packages/flyouts/packageNew/packageNew.container.js", "max_forks_repo_name": "colawwj/AI-Video-Intelligence-Solution-Accelerator", "max_forks_repo_forks_event_min_datetime": "2017-10-04T22:31:33.000Z", "max_forks_repo_forks_event_max_datetime": "2022-03-25T16:47:15.000Z"}
{"max_stars_count": 57, "max_issues_count": 478, "max_forks_count": 83, "avg_line_length": 38.7714285714, "max_line_length": 129, "alphanum_fraction": 0.7921886514}
// Copyright (c) Microsoft. All rights reserved.

import { connect } from 'react-redux';
import { withNamespaces } from 'react-i18next';
import { PackageNew } from './packageNew';
import {
  getCreatePackageError,
  getCreatePackagePendingStatus,
  epics as packagesEpics,
  redux as packagesRedux,
  getConfigTypes,
  getConfigTypesError,
  getConfigTypesPendingStatus
} from 'store/reducers/packagesReducer';
import { epics as appEpics } from 'store/reducers/appReducer';

// Pass the global info needed
const mapStateToProps = state => ({
  isPending: getCreatePackagePendingStatus(state),
  error: getCreatePackageError(state),
  configTypes: getConfigTypes(state),
  configTypesError: getConfigTypesError(state),
  configTypesIsPending: getConfigTypesPendingStatus(state)
});

// Wrap the dispatch methods
const mapDispatchToProps = dispatch => ({
  createPackage: packageModel => dispatch(packagesEpics.actions.createPackage(packageModel)),
  resetPackagesPendingError: () => dispatch(packagesRedux.actions.resetPendingAndError(packagesEpics.actionTypes.createPackage)),
  logEvent: diagnosticsModel => dispatch(appEpics.actions.logEvent(diagnosticsModel)),
  fetchConfigTypes: () => dispatch(packagesEpics.actions.fetchConfigTypes())
});

export const PackageNewContainer = withNamespaces()(connect(mapStateToProps, mapDispatchToProps)(PackageNew));
