diff --git a/src/components/post/comment-tools/comment-tools.tsx b/src/components/post/comment-tools/comment-tools.tsx index a2d04502..27370b36 100644 --- a/src/components/post/comment-tools/comment-tools.tsx +++ b/src/components/post/comment-tools/comment-tools.tsx @@ -31,6 +31,26 @@ interface CommentToolsProps { showReplyForm?: () => void; } +interface ModOrReportButtonProps { + cid: string; + isAuthor: boolean | undefined; + isMod: boolean | undefined; +} + +const ModOrReportButton = ({ cid, isAuthor, isMod }: ModOrReportButtonProps) => { + const { t } = useTranslation(); + + return isMod ? ( + + ) : ( + !isAuthor && ( +
  • + {t('report')} +
  • + ) + ); +}; + const PostTools = ({ author, cid, hasLabel, index, isAuthor, isMod, subplebbitAddress, replyCount = 0, showEditForm, spoiler = false }: CommentToolsProps) => { const { t } = useTranslation(); const validReplyCount = isNaN(replyCount) ? 0 : replyCount; @@ -61,15 +81,7 @@ const PostTools = ({ author, cid, hasLabel, index, isAuthor, isMod, subplebbitAd
  • {t('crosspost')}
  • - {isMod ? ( - - ) : ( - !isAuthor && ( -
  • - {t('report')} -
  • - ) - )} + ); }; @@ -91,15 +103,7 @@ const ReplyTools = ({ author, cid, hasLabel, index, isAuthor, isMod, showReplyFo
  • cid && showReplyForm?.()}>{t('reply_reply')}
  • - {isMod ? ( - - ) : ( - !isAuthor && ( -
  • - {t('report')} -
  • - ) - )} + ); }; @@ -144,15 +148,7 @@ const SingleReplyTools = ({
  • cid && showReplyForm?.()}>{t('reply_reply')}
  • - {isMod ? ( - - ) : ( - !isAuthor && ( -
  • - {t('report')} -
  • - ) - )} + ); };