diff --git a/src/components/epigram/Comment/CommentItem.tsx b/src/components/epigram/Comment/CommentItem.tsx index e6ca9503..959b3d9e 100644 --- a/src/components/epigram/Comment/CommentItem.tsx +++ b/src/components/epigram/Comment/CommentItem.tsx @@ -6,6 +6,7 @@ import getCustomRelativeTime from '@/lib/dateUtils'; import { Button } from '@/components/ui/button'; import useDeleteCommentMutation from '@/hooks/useDeleteCommentHook'; import UserProfileModal from '@/components/Card/UserProfileModal'; +import { sampleImage } from '@/user/utill/constants'; import DeleteAlertModal from '../DeleteAlertModal'; import CommentTextarea from './CommentTextarea'; @@ -46,7 +47,7 @@ function CommentItem({ comment, status, onEditComment, isEditing, epigramId }: C
- 프로필 이미지 + 프로필 이미지
@@ -79,7 +80,7 @@ function CommentItem({ comment, status, onEditComment, isEditing, epigramId }: C )}
{comment.content}
diff --git a/src/components/epigram/EditEpigram.tsx b/src/components/epigram/EditEpigram.tsx index 8079b5e7..749faeb2 100644 --- a/src/components/epigram/EditEpigram.tsx +++ b/src/components/epigram/EditEpigram.tsx @@ -24,6 +24,7 @@ function EditEpigram({ epigram }: EditEpigramProps) { const router = useRouter(); const [isAlertOpen, setIsAlertOpen] = useState(false); const [alertContent, setAlertContent] = useState({ title: '', description: '' }); + const [textCount, setTextCount] = useState(epigram.content.length); const form = useForm({ resolver: zodResolver(AddEpigramFormSchema), @@ -53,6 +54,15 @@ function EditEpigram({ epigram }: EditEpigramProps) { } }, [epigram, form]); + useEffect(() => { + const subscription = form.watch((value, { name }) => { + if (name === 'content') { + setTextCount(value.content?.length || 0); + } + }); + return () => subscription.unsubscribe(); + }, [form]); + const { currentTag, setCurrentTag, handleAddTag, handleRemoveTag } = useTagManagement({ setValue: form.setValue, getValues: form.getValues, @@ -134,7 +144,16 @@ function EditEpigram({ epigram }: EditEpigramProps) { 내용 -