2021-03-11 18:08:11 +01:00
|
|
|
import { connect } from 'react-redux';
|
2021-11-15 15:08:23 +01:00
|
|
|
import { doFetchSubCount, selectSubCountForUri } from 'lbryinc';
|
2022-02-01 21:22:56 +01:00
|
|
|
import { selectClaimForUri } from 'redux/selectors/claims';
|
2021-03-11 18:08:11 +01:00
|
|
|
import FileTitleSection from './view';
|
2022-02-01 21:22:56 +01:00
|
|
|
import { getClaimTitle } from 'util/claim';
|
2021-03-11 18:08:11 +01:00
|
|
|
|
2021-06-17 20:55:23 +02:00
|
|
|
const select = (state, props) => {
|
2022-02-01 21:22:56 +01: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 17:25:45 +02:00
|
|
|
|
2021-06-17 20:55:23 +02:00
|
|
|
return {
|
2022-02-01 21:22:56 +01:00
|
|
|
subCount: channelUri && selectSubCountForUri(state, channelUri),
|
2021-08-19 17:25:45 +02:00
|
|
|
channelClaimId,
|
2022-02-01 21:22:56 +01:00
|
|
|
title,
|
2021-06-17 20:55:23 +02:00
|
|
|
};
|
|
|
|
};
|
2021-03-11 18:08:11 +01:00
|
|
|
|
2022-02-01 21:22:56 +01:00
|
|
|
const perform = {
|
|
|
|
doFetchSubCount,
|
|
|
|
};
|
2021-08-19 17:25:45 +02:00
|
|
|
|
|
|
|
export default connect(select, perform)(FileTitleSection);
|