aboutsummaryrefslogtreecommitdiffstats
path: root/apps/web/components/dashboard/bookmarks/EditorCard.tsx
diff options
context:
space:
mode:
authorkamtschatka <sschatka@gmail.com>2024-05-25 23:20:17 +0200
committerGitHub <noreply@github.com>2024-05-25 22:20:17 +0100
commit033e8a2d26bb0ecaa8301609960d35d3467a88f4 (patch)
tree8c899a081b1cdd31eb24ab851b7a5c9d1dec858e /apps/web/components/dashboard/bookmarks/EditorCard.tsx
parentbb431be02850ca37f89cc40ce958226f64fe5ad5 (diff)
downloadkarakeep-033e8a2d26bb0ecaa8301609960d35d3467a88f4.tar.zst
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>
Diffstat (limited to 'apps/web/components/dashboard/bookmarks/EditorCard.tsx')
-rw-r--r--apps/web/components/dashboard/bookmarks/EditorCard.tsx15
1 files changed, 2 insertions, 13 deletions
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",
});
}