2021-03-11 12:08:11 -05:00
|
|
|
import { connect } from 'react-redux';
|
2021-11-15 22:08:23 +08:00
|
|
|
import { doFetchSubCount, selectSubCountForUri } from 'lbryinc';
|
2022-02-01 17:22:56 -03:00
|
|
|
import { selectClaimForUri } from 'redux/selectors/claims';
|
2021-03-11 12:08:11 -05:00
|
|
|
import FileTitleSection from './view';
|
2022-02-01 17:22:56 -03:00
|
|
|
import { getClaimTitle } from 'util/claim';
|
2021-03-11 12:08:11 -05:00
|
|
|
|
2021-06-17 14:55:23 -04:00
|
|
|
const select = (state, props) => {
|
2022-02-01 17:22:56 -03:00
|
|
|
const { uri } = props;
|
|
|
|
|
|
|
|
const claim = selectClaimForUri(state, uri);
|
|
|
|
|
|
|
|
const { signing_channel: channel } = claim || {};
|
|
|
|
const channelUri = channel && channel.canonical_url;
|
|
|
|
const channelClaimId = channel && channel.claim_id;
|
|
|
|
const title = getClaimTitle(claim);
|
2021-08-19 12:25:45 -03:00
|
|
|
|
2021-06-17 14:55:23 -04:00
|
|
|
return {
|
2022-02-01 17:22:56 -03:00
|
|
|
subCount: channelUri && selectSubCountForUri(state, channelUri),
|
2021-08-19 12:25:45 -03:00
|
|
|
channelClaimId,
|
2022-02-01 17:22:56 -03:00
|
|
|
title,
|
2021-06-17 14:55:23 -04:00
|
|
|
};
|
|
|
|
};
|
2021-03-11 12:08:11 -05:00
|
|
|
|
2022-02-01 17:22:56 -03:00
|
|
|
const perform = {
|
|
|
|
doFetchSubCount,
|
|
|
|
};
|
2021-08-19 12:25:45 -03:00
|
|
|
|
|
|
|
export default connect(select, perform)(FileTitleSection);
|