DetailsContainer.ts 568 B

12345678910111213141516171819202122232425
  1. import { connect } from 'react-redux';
  2. import { ClusterName, RootState, TopicName } from 'redux/interfaces';
  3. import { withRouter, RouteComponentProps } from 'react-router-dom';
  4. import Details from './Details';
  5. interface RouteProps {
  6. clusterName: ClusterName;
  7. topicName: TopicName;
  8. }
  9. type OwnProps = RouteComponentProps<RouteProps>;
  10. const mapStateToProps = (
  11. state: RootState,
  12. {
  13. match: {
  14. params: { topicName, clusterName },
  15. },
  16. }: OwnProps
  17. ) => ({
  18. clusterName,
  19. topicName,
  20. });
  21. export default withRouter(connect(mapStateToProps)(Details));