import { Gridicon } from '@automattic/components'; import { Button } from '@wordpress/components'; import { useTranslate } from 'i18n-calypso'; import ShareButton from 'calypso/blocks/reader-share'; import { shouldShowReblog } from 'calypso/blocks/reader-share/helper'; import { useSelector } from 'calypso/state'; import getPrimarySiteId from 'calypso/state/selectors/get-primary-site-id'; import CommentLikeButtonContainer from './comment-likes'; import './comment-actions.scss'; const CommentActions = ( { post, comment, comment: { isPlaceholder }, activeReplyCommentId, commentId, handleReply, onReplyCancel, showReadMore, onReadMore, onLikeToggle, } ) => { const translate = useTranslate(); const showReplyButton = post && post.discussion && post.discussion.comments_open === true; const showCancelReplyButton = activeReplyCommentId === commentId; const hasSites = !! useSelector( getPrimarySiteId ); const showReblogButton = shouldShowReblog( post, hasSites ); // Only render actions for non placeholders if ( isPlaceholder ) { return null; } return (
{ showReadMore && ( ) } { showReplyButton && ( ) } { showReblogButton && ( ) } { showCancelReplyButton && ( ) }
); }; export default CommentActions;