// @flow import { ENABLE_CREATOR_REACTIONS } from 'config'; import * as ICONS from 'constants/icons'; import * as REACTION_TYPES from 'constants/reactions'; import React from 'react'; import classnames from 'classnames'; import Button from 'component/button'; import ChannelThumbnail from 'component/channelThumbnail'; type Props = { myReacts: Array, othersReacts: any, react: (string, string) => void, commentId: string, pendingCommentReacts: Array, claimIsMine: boolean, activeChannel: string, claim: ?ChannelClaim, }; export default function CommentReactions(props: Props) { const { myReacts, othersReacts, commentId, react, claimIsMine, claim, activeChannel } = props; const canCreatorReact = claimIsMine && claim && claim.name === activeChannel; const authorUri = claim && claim.value_type === 'channel' ? claim.canonical_url : ''; const getCountForReact = type => { let count = 0; if (othersReacts && othersReacts[type]) { count += othersReacts[type]; } if (myReacts && myReacts.includes(type)) { count += 1; } return count; }; const creatorLiked = getCountForReact(REACTION_TYPES.CREATOR_LIKE) > 0; return ( <> )} ); }