(bookmark: BookmarkWithCategory)
| 247 | }; |
| 248 | |
| 249 | const handleDelete = async (bookmark: BookmarkWithCategory) => { |
| 250 | setIsDeleting(true); |
| 251 | setBookmarkToDelete(bookmark); |
| 252 | |
| 253 | try { |
| 254 | const deleteData = { |
| 255 | id: bookmark.id.toString(), |
| 256 | url: bookmark.url, |
| 257 | }; |
| 258 | const result = await deleteBookmark(null, deleteData); |
| 259 | |
| 260 | if (result.success) { |
| 261 | toast.success("Bookmark deleted!"); |
| 262 | setBookmarkToDelete(null); |
| 263 | } else { |
| 264 | toast.error(result.error || "Failed to delete bookmark"); |
| 265 | } |
| 266 | } catch (err) { |
| 267 | console.error("Error deleting bookmark:", err); |
| 268 | toast.error("Failed to delete bookmark"); |
| 269 | } finally { |
| 270 | setIsDeleting(false); |
| 271 | } |
| 272 | }; |
| 273 | |
| 274 | const handleTitleChange = (e: React.ChangeEvent<HTMLInputElement>) => { |
| 275 | const title = e.target.value; |
no test coverage detected