From 033e8a2d26bb0ecaa8301609960d35d3467a88f4 Mon Sep 17 00:00:00 2001
From: kamtschatka <sschatka@gmail.com>
Date: Sat, 25 May 2024 23:20:17 +0200
Subject: feature: Allow import Netscape HTML format (#163)

* [Feature request] Netscape HTML format import/export #96
added the possibility to add exported bookmarks via the webUI for ease of use

* [Feature request] Netscape HTML format import/export #96
updated the documentation

* Extract the parser into its own file and reuse the existing bookmark upload logic

---------

Co-authored-by: kamtschatka <simon.schatka@gmx.at>
Co-authored-by: MohamedBassem <me@mbassem.com>
---
 apps/web/components/dashboard/bookmarks/EditorCard.tsx | 15 ++-------------
 1 file changed, 2 insertions(+), 13 deletions(-)

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

diff --git a/apps/web/components/dashboard/bookmarks/EditorCard.tsx b/apps/web/components/dashboard/bookmarks/EditorCard.tsx
index 8425f669..44d68378 100644
--- a/apps/web/components/dashboard/bookmarks/EditorCard.tsx
+++ b/apps/web/components/dashboard/bookmarks/EditorCard.tsx
@@ -1,6 +1,5 @@
 import type { SubmitErrorHandler, SubmitHandler } from "react-hook-form";
 import React, { useEffect, useImperativeHandle, useRef } from "react";
-import Link from "next/link";
 import { ActionButton } from "@/components/ui/action-button";
 import { Form, FormControl, FormItem } from "@/components/ui/form";
 import InfoTooltip from "@/components/ui/info-tooltip";
@@ -8,11 +7,11 @@ import MultipleChoiceDialog from "@/components/ui/multiple-choice-dialog";
 import { Separator } from "@/components/ui/separator";
 import { Textarea } from "@/components/ui/textarea";
 import { toast } from "@/components/ui/use-toast";
+import BookmarkAlreadyExistsToast from "@/components/utils/BookmarkAlreadyExistsToast";
 import { useClientConfig } from "@/lib/clientConfig";
 import { useBookmarkLayoutSwitch } from "@/lib/userLocalSettings/bookmarksLayout";
 import { cn } from "@/lib/utils";
 import { zodResolver } from "@hookform/resolvers/zod";
-import { ExternalLink } from "lucide-react";
 import { useForm } from "react-hook-form";
 import { z } from "zod";
 
@@ -64,17 +63,7 @@ export default function EditorCard({ className }: { className?: string }) {
     onSuccess: (resp) => {
       if (resp.alreadyExists) {
         toast({
-          description: (
-            <div className="flex items-center gap-1">
-              Bookmark already exists.
-              <Link
-                className="flex underline-offset-4 hover:underline"
-                href={`/dashboard/preview/${resp.id}`}
-              >
-                Open <ExternalLink className="ml-1 size-4" />
-              </Link>
-            </div>
-          ),
+          description: <BookmarkAlreadyExistsToast bookmarkId={resp.id} />,
           variant: "default",
         });
       }
-- 
cgit v1.2.3-70-g09d2

