()
| 60 | }) |
| 61 | |
| 62 | const handleDelete = async () => { |
| 63 | if (!confirm("Are you sure you want to delete this comment?")) return |
| 64 | |
| 65 | setIsDeleting(true) |
| 66 | try { |
| 67 | if (isAdmin && !isOwner) { |
| 68 | await adminDeleteComment({ commentId: comment._id }) |
| 69 | } else { |
| 70 | await removeComment({ commentId: comment._id }) |
| 71 | } |
| 72 | } catch (err) { |
| 73 | console.error("Failed to delete comment:", err) |
| 74 | alert("Failed to delete comment") |
| 75 | } finally { |
| 76 | setIsDeleting(false) |
| 77 | } |
| 78 | } |
| 79 | |
| 80 | const handleLike = async () => { |
| 81 | if (!isAuthenticated) return |
nothing calls this directly
no outgoing calls
no test coverage detected