summaryrefslogtreecommitdiffstats
path: root/webapp/components/integrations/components/commands_container/index.js
blob: ed0a4c138b183dcf9d4b9e557a52e91bea1d3f51 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// Copyright (c) 2017 Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.

import {connect} from 'react-redux';
import {bindActionCreators} from 'redux';
import {getCustomTeamCommands} from 'mattermost-redux/actions/integrations';

import {getCommands} from 'mattermost-redux/selectors/entities/integrations';
import {getUsers} from 'mattermost-redux/selectors/entities/users';

import CommandsContainer from './commands_container.jsx';

function mapStateToProps(state, ownProps) {
    return {
        ...ownProps,
        commands: Object.values(getCommands(state)),
        users: getUsers(state)
    };
}

function mapDispatchToProps(dispatch) {
    return {
        actions: bindActionCreators({
            getCustomTeamCommands
        }, dispatch)
    };
}

export default connect(mapStateToProps, mapDispatchToProps)(CommandsContainer);