2021-12-02 17:49:13 +01:00
|
|
|
import { connect } from 'react-redux';
|
2022-03-09 19:05:37 +01:00
|
|
|
import { selectClaimForUri, selectOdyseeMembershipForUri } from 'redux/selectors/claims';
|
2021-12-02 17:49:13 +01:00
|
|
|
import TextareaSuggestionsItem from './view';
|
2022-02-02 13:49:02 +01:00
|
|
|
import { formatLbryChannelName } from 'util/url';
|
|
|
|
import { getClaimTitle } from 'util/claim';
|
2021-12-02 17:49:13 +01:00
|
|
|
|
2022-02-02 13:49:02 +01:00
|
|
|
const select = (state, props) => {
|
|
|
|
const { uri } = props;
|
|
|
|
|
|
|
|
const claim = uri && selectClaimForUri(state, uri);
|
|
|
|
|
|
|
|
return {
|
|
|
|
claimLabel: claim && formatLbryChannelName(claim.canonical_url),
|
2022-02-26 19:47:54 +01:00
|
|
|
claimTitle: claim && getClaimTitle(claim),
|
2022-03-09 19:05:37 +01:00
|
|
|
odyseeMembershipByUri: selectOdyseeMembershipForUri(state, uri),
|
2022-02-02 13:49:02 +01:00
|
|
|
};
|
|
|
|
};
|
2021-12-02 17:49:13 +01:00
|
|
|
|
|
|
|
export default connect(select)(TextareaSuggestionsItem);
|