ListContainer.ts 634 B

123456789101112131415161718192021
  1. import { connect } from 'react-redux';
  2. import { RootState } from 'redux/interfaces';
  3. import { getTopicList, getExternalTopicList } from 'redux/reducers/topics/selectors';
  4. import List from './List';
  5. import { withRouter, RouteComponentProps } from 'react-router-dom';
  6. interface RouteProps {
  7. clusterId: string;
  8. }
  9. interface OwnProps extends RouteComponentProps<RouteProps> { }
  10. const mapStateToProps = (state: RootState, { match: { params: { clusterId } } }: OwnProps) => ({
  11. clusterId,
  12. topics: getTopicList(state),
  13. externalTopics: getExternalTopicList(state),
  14. });
  15. export default withRouter(
  16. connect(mapStateToProps)(List)
  17. );