import { connect } from 'react-redux'; import { ClusterName, RootState, TopicName } from 'redux/interfaces'; import { withRouter, RouteComponentProps } from 'react-router-dom'; import Details from './Details'; interface RouteProps { clusterName: ClusterName; topicName: TopicName; } type OwnProps = RouteComponentProps; const mapStateToProps = ( state: RootState, { match: { params: { topicName, clusterName }, }, }: OwnProps ) => ({ clusterName, topicName, }); export default withRouter(connect(mapStateToProps)(Details));