From 75d315dda4232ee3b89abf054f0b6ee10105ffe3 Mon Sep 17 00:00:00 2001
From: MohamedBassem <me@mbassem.com>
Date: Fri, 1 Mar 2024 18:00:58 +0000
Subject: feature: Add support for creating and updating lists

---
 .../app/dashboard/bookmarks/components/BookmarkOptions.tsx    | 11 +++++++++++
 1 file changed, 11 insertions(+)

(limited to 'packages/web/app/dashboard/bookmarks/components/BookmarkOptions.tsx')

diff --git a/packages/web/app/dashboard/bookmarks/components/BookmarkOptions.tsx b/packages/web/app/dashboard/bookmarks/components/BookmarkOptions.tsx
index 3a2b6b35..d4447f29 100644
--- a/packages/web/app/dashboard/bookmarks/components/BookmarkOptions.tsx
+++ b/packages/web/app/dashboard/bookmarks/components/BookmarkOptions.tsx
@@ -13,6 +13,7 @@ import {
 import {
   Archive,
   Link,
+  List,
   MoreHorizontal,
   Pencil,
   RotateCw,
@@ -23,12 +24,16 @@ import {
 import { useTagModel } from "./TagModal";
 import { useState } from "react";
 import { BookmarkedTextEditor } from "./BookmarkedTextEditor";
+import { useAddToListModal } from "./AddToListModal";
 
 export default function BookmarkOptions({ bookmark }: { bookmark: ZBookmark }) {
   const { toast } = useToast();
   const linkId = bookmark.id;
 
   const [_, setTagModalIsOpen, tagModal] = useTagModel(bookmark);
+  const [_2, setAddToListModalOpen, addToListModal] = useAddToListModal(
+    bookmark.id,
+  );
 
   const [isTextEditorOpen, setTextEditorOpen] = useState(false);
 
@@ -77,6 +82,7 @@ export default function BookmarkOptions({ bookmark }: { bookmark: ZBookmark }) {
   return (
     <>
       {tagModal}
+      {addToListModal}
       <BookmarkedTextEditor
         bookmark={bookmark}
         open={isTextEditorOpen}
@@ -140,6 +146,11 @@ export default function BookmarkOptions({ bookmark }: { bookmark: ZBookmark }) {
             <span>Edit Tags</span>
           </DropdownMenuItem>
 
+          <DropdownMenuItem onClick={() => setAddToListModalOpen(true)}>
+            <List className="mr-2 size-4" />
+            <span>Add to List</span>
+          </DropdownMenuItem>
+
           {bookmark.content.type === "link" && (
             <DropdownMenuItem
               onClick={() =>
-- 
cgit v1.2.3-70-g09d2

