feat: tạo hook useConfirm.tsx để dùng chung toàn hệ thống

This commit is contained in:
2026-06-16 12:29:09 +07:00
parent 047170d4be
commit 29d39ae7b0
4 changed files with 297 additions and 18 deletions
+2 -2
View File
@@ -2,7 +2,7 @@ import React, { useState, useEffect } from 'react';
import { X, Send, MessageSquare, User, Loader2, Trash2 } from 'lucide-react';
import { io } from 'socket.io-client';
import { useTourStore } from '@/store/useTourStore';
import { ConfirmModal } from './ConfirmModal';
import { useConfirm } from '@/hooks/useConfirm';
interface Comment {
id: string;
@@ -26,7 +26,7 @@ export const CommentModal: React.FC<CommentModalProps> = ({ isOpen, onClose, loc
const [comments, setComments] = useState<Comment[]>([]);
const [newComment, setNewComment] = useState('');
const [isLoading, setIsLoading] = useState(false);
const [confirmState, setConfirmState] = useState<{ open: boolean; commentId: string }>({ open: false, commentId: '' });
const confirm = useConfirm();
const userRole = useTourStore(state => state.userRole);
const currentUserId = React.useMemo(() => {