feat: 增强评论功能,添加评论未更改提示,优化评论输入组件的占位符

This commit is contained in:
2025-09-10 11:59:42 +08:00
parent b380e971cc
commit 09c024ccbb
4 changed files with 39 additions and 14 deletions

View File

@ -33,6 +33,7 @@ export function CommentSection(
const [currentUser, setCurrentUser] = useState<User | null>(null);
const [comments, setComments] = useState<Comment[]>([]);
const [refreshCommentsKey, setRefreshCommentsKey] = useState(0);
const [activeInput, setActiveInput] = useState<{ id: number; type: 'reply' | 'edit' } | null>(null);
// 获取当前登录用户
useEffect(() => {
@ -98,6 +99,8 @@ export function CommentSection(
comment={comment}
parentComment={null}
onCommentDelete={onCommentDelete}
activeInput={activeInput}
setActiveInputId={setActiveInput}
/>
</div>
))}