From e0999f701cd1834c3d940113cd8dd5247c5fe95f Mon Sep 17 00:00:00 2001
From: Mohamed Bassem <me@mbassem.com>
Date: Fri, 19 Apr 2024 00:09:27 +0100
Subject: feature: Nested lists (#110). Fixes #62

* feature: Add support for nested lists

* prevent moving the parent to a subtree
---
 .../dashboard/lists/DeleteListButton.tsx           | 53 ----------------------
 1 file changed, 53 deletions(-)
 delete mode 100644 apps/web/components/dashboard/lists/DeleteListButton.tsx

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

diff --git a/apps/web/components/dashboard/lists/DeleteListButton.tsx b/apps/web/components/dashboard/lists/DeleteListButton.tsx
deleted file mode 100644
index 774b79ac..00000000
--- a/apps/web/components/dashboard/lists/DeleteListButton.tsx
+++ /dev/null
@@ -1,53 +0,0 @@
-"use client";
-
-import { useRouter } from "next/navigation";
-import { ActionButton } from "@/components/ui/action-button";
-import ActionConfirmingDialog from "@/components/ui/action-confirming-dialog";
-import { Button } from "@/components/ui/button";
-import { toast } from "@/components/ui/use-toast";
-import { api } from "@/lib/trpc";
-import { Trash2 } from "lucide-react";
-
-import type { ZBookmarkList } from "@hoarder/shared/types/lists";
-
-export default function DeleteListButton({ list }: { list: ZBookmarkList }) {
-  const router = useRouter();
-
-  const listsInvalidationFunction = api.useUtils().lists.list.invalidate;
-  const { mutate: deleteList, isPending } = api.lists.delete.useMutation({
-    onSuccess: () => {
-      listsInvalidationFunction();
-      toast({
-        description: `List "${list.icon} ${list.name}" is deleted!`,
-      });
-      router.push("/");
-    },
-    onError: () => {
-      toast({
-        variant: "destructive",
-        description: `Something went wrong`,
-      });
-    },
-  });
-  return (
-    <ActionConfirmingDialog
-      title={`Delete ${list.icon} ${list.name}?`}
-      description={`Are you sure you want to delete ${list.icon} ${list.name}?`}
-      actionButton={() => (
-        <ActionButton
-          type="button"
-          variant="destructive"
-          loading={isPending}
-          onClick={() => deleteList({ listId: list.id })}
-        >
-          Delete
-        </ActionButton>
-      )}
-    >
-      <Button className="mt-auto flex gap-2" variant="destructiveOutline">
-        <Trash2 className="size-5" />
-        <span className="hidden md:block">Delete List</span>
-      </Button>
-    </ActionConfirmingDialog>
-  );
-}
-- 
cgit v1.2.3-70-g09d2

