From 52024ab52724b45c08f437f9f10805adefe2bf0e Mon Sep 17 00:00:00 2001
From: MohamedBassem <me@mbassem.com>
Date: Sat, 21 Sep 2024 15:23:23 +0000
Subject: feature(web): Move bookmark imports into settings

---
 apps/web/components/dashboard/UploadDropzone.tsx | 29 ++----------------------
 1 file changed, 2 insertions(+), 27 deletions(-)

(limited to 'apps/web/components/dashboard/UploadDropzone.tsx')

diff --git a/apps/web/components/dashboard/UploadDropzone.tsx b/apps/web/components/dashboard/UploadDropzone.tsx
index e57f9294..335ac72a 100644
--- a/apps/web/components/dashboard/UploadDropzone.tsx
+++ b/apps/web/components/dashboard/UploadDropzone.tsx
@@ -2,9 +2,7 @@
 
 import React, { useCallback, useState } from "react";
 import useUpload from "@/lib/hooks/upload-file";
-import { parseNetscapeBookmarkFile } from "@/lib/netscapeBookmarkParser";
 import { cn } from "@/lib/utils";
-import { useMutation } from "@tanstack/react-query";
 import { TRPCClientError } from "@trpc/client";
 import DropZone from "react-dropzone";
 
@@ -46,34 +44,11 @@ export function useUploadAsset() {
     },
   });
 
-  const { mutateAsync: runUploadBookmarkFile } = useMutation({
-    mutationFn: async (file: File) => {
-      return await parseNetscapeBookmarkFile(file);
-    },
-    onSuccess: async (resp) => {
-      return Promise.all(
-        resp.map((url) =>
-          createBookmark({ type: BookmarkTypes.LINK, url: url.toString() }),
-        ),
-      );
-    },
-    onError: (error) => {
-      toast({
-        description: error.message,
-        variant: "destructive",
-      });
-    },
-  });
-
   return useCallback(
     (file: File) => {
-      if (file.type === "text/html") {
-        return runUploadBookmarkFile(file);
-      } else {
-        return runUploadAsset(file);
-      }
+      return runUploadAsset(file);
     },
-    [runUploadAsset, runUploadBookmarkFile],
+    [runUploadAsset],
   );
 }
 
-- 
cgit v1.2.3-70-g09d2

