lbry-desktop/ui/component/fileTitleSection/index.js

18 lines
685 B
JavaScript
Raw Normal View History

2021-03-11 18:08:11 +01:00
import { connect } from 'react-redux';
2021-06-17 20:55:23 +02:00
import { makeSelectTitleForUri, makeSelectClaimForUri } from 'lbry-redux';
2021-03-11 18:08:11 +01:00
import { makeSelectInsufficientCreditsForUri } from 'redux/selectors/content';
2021-06-17 20:55:23 +02:00
import { makeSelectViewersForId } from 'redux/selectors/livestream';
2021-03-11 18:08:11 +01:00
import FileTitleSection from './view';
2021-06-17 20:55:23 +02:00
const select = (state, props) => {
const claim = makeSelectClaimForUri(props.uri)(state);
const viewers = claim && makeSelectViewersForId(claim.claim_id)(state);
return {
viewers,
isInsufficientCredits: makeSelectInsufficientCreditsForUri(props.uri)(state),
title: makeSelectTitleForUri(props.uri)(state),
};
};
2021-03-11 18:08:11 +01:00
export default connect(select)(FileTitleSection);