2021-06-18 17:22:44 +02:00
|
|
|
import { connect } from 'react-redux';
|
2021-10-08 05:47:39 +02:00
|
|
|
import { doCollectionEdit } from 'redux/actions/collections';
|
|
|
|
import { makeSelectCollectionForIdHasClaimUrl } from 'redux/selectors/collections';
|
|
|
|
import * as COLLECTIONS_CONSTS from 'constants/collections';
|
2021-06-18 17:22:44 +02:00
|
|
|
import FileWatchLaterLink from './view';
|
|
|
|
import { doToast } from 'redux/actions/notifications';
|
|
|
|
|
|
|
|
const select = (state, props) => {
|
2022-01-27 16:20:21 +01:00
|
|
|
const { uri } = props;
|
2021-06-18 17:22:44 +02:00
|
|
|
|
|
|
|
return {
|
2022-01-27 16:20:21 +01:00
|
|
|
hasClaimInWatchLater: makeSelectCollectionForIdHasClaimUrl(COLLECTIONS_CONSTS.WATCH_LATER_ID, uri)(state),
|
2021-06-18 17:22:44 +02:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2021-10-08 05:47:39 +02:00
|
|
|
const perform = (dispatch) => ({
|
2021-06-18 17:22:44 +02:00
|
|
|
doToast: (props) => dispatch(doToast(props)),
|
|
|
|
doCollectionEdit: (collection, props) => dispatch(doCollectionEdit(collection, props)),
|
|
|
|
});
|
|
|
|
|
|
|
|
export default connect(select, perform)(FileWatchLaterLink);
|