2021-12-02 17:49:13 +01:00
|
|
|
import { connect } from 'react-redux';
|
2021-12-06 18:28:36 +01:00
|
|
|
import { selectClaimForUri } 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),
|
|
|
|
claimTitle: claim && getClaimTitle(claim.canonical_url),
|
|
|
|
};
|
|
|
|
};
|
2021-12-02 17:49:13 +01:00
|
|
|
|
|
|
|
export default connect(select)(TextareaSuggestionsItem);
|