diff --git a/src/components/Home/Comment/Comment.tsx b/src/components/Home/Comment/Comment.tsx index b7d97ac..4bdc410 100644 --- a/src/components/Home/Comment/Comment.tsx +++ b/src/components/Home/Comment/Comment.tsx @@ -7,6 +7,7 @@ import ProfileImg from '@components/commons/ProfileImg/ProfileImg'; import Text from '@components/commons/Text/Text'; import useModal from '@hooks/useModal/useModal'; import { CommentResponse } from '@interfaces/api/comment'; +import { Choice } from '@interfaces/api/topic'; import { useAuthStore } from '@store/auth'; @@ -18,9 +19,10 @@ import Thumbs from './Thumbs'; interface CommentProps { comment: CommentResponse; + choices: Choice[]; } -const Comment = React.memo(({ comment }: CommentProps) => { +const Comment = React.memo(({ comment, choices }: CommentProps) => { const { Modal, toggleModal } = useModal('action'); const reactMutation = useReactComment(comment.topicId, comment.commentId); const memberId = useAuthStore((store) => store.memberId); @@ -79,8 +81,12 @@ const Comment = React.memo(({ comment }: CommentProps) => { {'·'} {distanceText}전 - - {comment.writersVotedOption} + + {choices[comment.writersVotedOption === 'CHOICE_A' ? 0 : 1].content.text} diff --git a/src/components/Home/TopicComments/TopicComments.tsx b/src/components/Home/TopicComments/TopicComments.tsx index 13cd403..cd76bd1 100644 --- a/src/components/Home/TopicComments/TopicComments.tsx +++ b/src/components/Home/TopicComments/TopicComments.tsx @@ -45,7 +45,9 @@ const TopicComments = memo(({ topic }: TopicCommentsProps) => { - {comments?.map((comment) => )} + {comments?.map((comment) => ( + + ))}