2018-07-24 20:50:04 -04:00
|
|
|
import { connect } from 'react-redux';
|
2022-03-15 12:07:31 -07:00
|
|
|
import { withRouter } from 'react-router';
|
2022-03-02 07:10:29 -08:00
|
|
|
import { selectClaimForUri } from 'redux/selectors/claims';
|
2021-03-19 23:04:12 +08:00
|
|
|
import { doFetchRecommendedContent } from 'redux/actions/search';
|
2021-11-16 09:10:03 +08:00
|
|
|
import { selectRecommendedContentForUri, selectIsSearching } from 'redux/selectors/search';
|
2022-03-09 19:05:37 +01:00
|
|
|
import { selectOdyseeMembershipIsPremiumPlus } from 'redux/selectors/user';
|
2021-07-06 09:29:46 +08:00
|
|
|
import RecommendedContent from './view';
|
2018-07-24 20:50:04 -04:00
|
|
|
|
2021-09-02 18:39:40 -04:00
|
|
|
const select = (state, props) => {
|
2021-11-16 09:10:03 +08:00
|
|
|
const recommendedContentUris = selectRecommendedContentForUri(state, props.uri);
|
2021-09-16 17:00:44 -03:00
|
|
|
const nextRecommendedUri = recommendedContentUris && recommendedContentUris[0];
|
|
|
|
|
2021-09-02 18:39:40 -04:00
|
|
|
return {
|
2022-03-02 07:10:29 -08:00
|
|
|
claim: selectClaimForUri(state, props.uri),
|
2021-09-16 17:00:44 -03:00
|
|
|
recommendedContentUris,
|
|
|
|
nextRecommendedUri,
|
|
|
|
isSearching: selectIsSearching(state),
|
2022-05-18 20:51:15 +02:00
|
|
|
hasPremiumPlus: selectOdyseeMembershipIsPremiumPlus(state),
|
2021-09-02 18:39:40 -04:00
|
|
|
};
|
|
|
|
};
|
2018-07-24 20:50:04 -04:00
|
|
|
|
2022-03-15 12:07:31 -07:00
|
|
|
export default withRouter(connect(select, { doFetchRecommendedContent })(RecommendedContent));
|