This repository has been archived by the owner on Mar 13, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
/
index.ts
35 lines (27 loc) · 1.21 KB
/
index.ts
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
30
31
32
33
34
35
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {connect} from 'react-redux';
import {bindActionCreators, Dispatch} from 'redux';
import {getMissingProfilesByIds} from 'mattermost-redux/actions/users';
import {getUser, getCurrentUser} from 'mattermost-redux/selectors/entities/users';
import {getChannelByName} from 'mattermost-redux/selectors/entities/channels';
import {GenericAction} from 'mattermost-redux/types/actions';
import {getDirectTeammate} from 'utils/utils.jsx';
import {GlobalState} from 'types/store';
import AuditTable from './audit_table';
function mapStateToProps(state: GlobalState) {
return {
currentUser: getCurrentUser(state),
getUser: (userId: string) => getUser(state, userId),
getByName: (channelName: string) => getChannelByName(state, channelName),
getDirectTeammate: (channelId: string) => getDirectTeammate(state, channelId),
};
}
function mapDispatchToProps(dispatch: Dispatch<GenericAction>) {
return {
actions: bindActionCreators({
getMissingProfilesByIds,
}, dispatch),
};
}
export default connect(mapStateToProps, mapDispatchToProps)(AuditTable);