2021-12-02 17:49:13 +01:00
|
|
|
// @flow
|
|
|
|
import ChannelThumbnail from 'component/channelThumbnail';
|
|
|
|
import React from 'react';
|
|
|
|
|
|
|
|
type Props = {
|
|
|
|
claim?: Claim,
|
|
|
|
uri?: string,
|
|
|
|
};
|
|
|
|
|
|
|
|
export default function TextareaSuggestionsItem(props: Props) {
|
2021-12-06 18:28:36 +01:00
|
|
|
const { claim, uri, ...autocompleteProps } = props;
|
2021-12-02 17:49:13 +01:00
|
|
|
|
|
|
|
if (!claim) return null;
|
|
|
|
|
2021-12-06 18:28:36 +01:00
|
|
|
const value = claim.canonical_url.replace('lbry://', '').replace('#', ':');
|
2021-12-02 17:49:13 +01:00
|
|
|
|
|
|
|
return (
|
2021-12-06 18:28:36 +01:00
|
|
|
<div {...autocompleteProps}>
|
|
|
|
<ChannelThumbnail xsmall uri={uri} />
|
2021-12-02 17:49:13 +01:00
|
|
|
|
2021-12-06 18:28:36 +01:00
|
|
|
<div className="textareaSuggestion__label">
|
|
|
|
<span className="textareaSuggestion__title">{(claim.value && claim.value.title) || value}</span>
|
|
|
|
<span className="textareaSuggestion__value">{value}</span>
|
2021-12-02 17:49:13 +01:00
|
|
|
</div>
|
2021-12-06 18:28:36 +01:00
|
|
|
</div>
|
2021-12-02 17:49:13 +01:00
|
|
|
);
|
|
|
|
}
|