From 79d61be7e15dc5d23fb687a5f71e0097088a99ac Mon Sep 17 00:00:00 2001
From: MohamedBassem <me@mbassem.com>
Date: Sun, 7 Apr 2024 18:30:00 +0100
Subject: feature: Extract hook logic into separate package and add a new
 action bar in bookmark preview

---
 apps/browser-extension/src/BookmarkSavedPage.tsx | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

(limited to 'apps/browser-extension/src/BookmarkSavedPage.tsx')

diff --git a/apps/browser-extension/src/BookmarkSavedPage.tsx b/apps/browser-extension/src/BookmarkSavedPage.tsx
index 54f62796..3535ade8 100644
--- a/apps/browser-extension/src/BookmarkSavedPage.tsx
+++ b/apps/browser-extension/src/BookmarkSavedPage.tsx
@@ -2,24 +2,24 @@ import { useState } from "react";
 import { ArrowUpRightFromSquare, Trash } from "lucide-react";
 import { Link, useNavigate, useParams } from "react-router-dom";
 
+import { useDeleteBookmark } from "@hoarder/shared-react/hooks/bookmarks";
+
 import Spinner from "./Spinner";
 import usePluginSettings from "./utils/settings";
-import { api } from "./utils/trpc";
 
 export default function BookmarkSavedPage() {
   const { bookmarkId } = useParams();
   const navigate = useNavigate();
   const [error, setError] = useState("");
 
-  const { mutate: deleteBookmark, isPending } =
-    api.bookmarks.deleteBookmark.useMutation({
-      onSuccess: () => {
-        navigate("/bookmarkdeleted");
-      },
-      onError: (e) => {
-        setError(e.message);
-      },
-    });
+  const { mutate: deleteBookmark, isPending } = useDeleteBookmark({
+    onSuccess: () => {
+      navigate("/bookmarkdeleted");
+    },
+    onError: (e) => {
+      setError(e.message);
+    },
+  });
 
   const { settings } = usePluginSettings();
 
-- 
cgit v1.2.3-70-g09d2

