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