hunk.code_window: 		"@types/nanoevents": "^1.0.0",
   		"@types/node": "16.11.7",
   		"@types/react": "17.0.53",
   		"@types/react-beautiful-dnd": "^13.1.2",
   		"@types/react-day-picker": "5.3.0",
   		"@types/react-dom": "17.0.19",
   		"@types/react-redux": "^7.1.23",
   		"@types/react-router-dom": "^5.3.3",
   		"@types/react-transition-group": "4.4.4",
  
hunk.labels: keep keep keep keep replace keep keep keep keep
hunk.file_path: webapp/boards/package.json
hunk.type: replace
file: // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
  // See LICENSE.txt for license information.
  
  import {connect} from 'react-redux';
  import {ActionCreatorsMapObject, bindActionCreators, Dispatch} from 'redux';
  
  import {createIncomingHook} from 'mattermost-redux/actions/integrations';
  import {getConfig} from 'mattermost-redux/selectors/entities/general';
  
  import {GlobalState} from '@mattermost/types/store';
  import {Action, GenericAction} from 'mattermost-redux/types/actions';
  import {IncomingWebhook} from '@mattermost/types/integrations';
  
  import AddIncomingWebhook from './add_incoming_webhook';
  
  function mapStateToProps(state: GlobalState) {
      const config = getConfig(state);
      const enablePostUsernameOverride = config.EnablePostUsernameOverride === 'true';
      const enablePostIconOverride = config.EnablePostIconOverride === 'true';
  
      return {
          enablePostUsernameOverride,
          enablePostIconOverride,
      };
  }
  
  type Actions = {
      createIncomingHook: (hook: IncomingWebhook) => Promise<{ data?: IncomingWebhook; error?: Error }>;
  }
  
  function mapDispatchToProps(dispatch: Dispatch<GenericAction>) {
      return {
          actions: bindActionCreators<ActionCreatorsMapObject<Action>, Actions>({
              createIncomingHook,
          }, dispatch),
      };
  }
  
  export default connect(mapStateToProps, mapDispatchToProps)(AddIncomingWebhook);
  