From 2659da517aeec0fe955422dee76f7de292f1a591 Mon Sep 17 00:00:00 2001 From: MohamedBassem Date: Thu, 8 Feb 2024 02:16:51 +0000 Subject: [feature] Introduce a sidebar --- web/app/bookmarks/components/LinkCard.tsx | 96 ------------------------------- 1 file changed, 96 deletions(-) delete mode 100644 web/app/bookmarks/components/LinkCard.tsx (limited to 'web/app/bookmarks/components/LinkCard.tsx') diff --git a/web/app/bookmarks/components/LinkCard.tsx b/web/app/bookmarks/components/LinkCard.tsx deleted file mode 100644 index da59d9da..00000000 --- a/web/app/bookmarks/components/LinkCard.tsx +++ /dev/null @@ -1,96 +0,0 @@ -"use client"; - -import { Badge } from "@/components/ui/badge"; -import { Button } from "@/components/ui/button"; -import { - DropdownMenu, - DropdownMenuContent, - DropdownMenuItem, - DropdownMenuTrigger, -} from "@/components/ui/dropdown-menu"; -import { - ImageCard, - ImageCardBody, - ImageCardFooter, - ImageCardTitle, -} from "@/components/ui/imageCard"; -import { useToast } from "@/components/ui/use-toast"; -import APIClient from "@/lib/api"; -import { ZBookmarkedLink } from "@/lib/types/api/links"; -import { MoreHorizontal, Trash2 } from "lucide-react"; -import Link from "next/link"; -import { useRouter } from "next/navigation"; - -export function LinkOptions({ linkId }: { linkId: string }) { - const { toast } = useToast(); - const router = useRouter(); - - const unbookmarkLink = async () => { - let [_, error] = await APIClient.unbookmarkLink(linkId); - - if (error) { - toast({ - variant: "destructive", - title: "Something went wrong", - description: "There was a problem with your request.", - }); - } else { - toast({ - description: "The link has been deleted!", - }); - } - - router.refresh(); - }; - return ( - - - - - - - - Delete - - - - ); -} - -export default function LinkCard({ link }: { link: ZBookmarkedLink }) { - const parsedUrl = new URL(link.url); - - return ( - - - - {link.details?.title ?? parsedUrl.host} - - - - {link.tags.map((t) => ( - - #{t.name} - - ))} - - -
-
- - {parsedUrl.host} - -
- -
-
-
- ); -} -- cgit v1.2.3-70-g09d2