Skip to content

Commit 58224da

Browse files
committed
remove duplicateFolder
1 parent 026e03f commit 58224da

File tree

2 files changed

+16
-172
lines changed

2 files changed

+16
-172
lines changed

apps/web/actions/folders/duplicateFolder.ts

Lines changed: 0 additions & 147 deletions
This file was deleted.

apps/web/app/(org)/dashboard/caps/components/FoldersDropdown.tsx

Lines changed: 16 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,16 @@
1-
"use client";
2-
31
import {
42
DropdownMenu,
53
DropdownMenuContent,
64
DropdownMenuItem,
75
DropdownMenuTrigger,
86
} from "@cap/ui";
97
import {
10-
faCopy,
118
faEllipsis,
129
faPencil,
1310
faTrash,
1411
} from "@fortawesome/free-solid-svg-icons";
1512
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
1613
import { RefObject } from "react";
17-
import { toast } from "sonner";
18-
import { duplicateFolder } from "@/actions/folders/duplicateFolder";
19-
import { useDashboardContext } from "../../Contexts";
2014

2115
interface FoldersDropdownProps {
2216
id: string;
@@ -27,13 +21,10 @@ interface FoldersDropdownProps {
2721
}
2822

2923
export const FoldersDropdown = ({
30-
id,
31-
parentId,
3224
setIsRenaming,
3325
setConfirmDeleteFolderOpen,
3426
nameRef,
3527
}: FoldersDropdownProps) => {
36-
const { activeSpace } = useDashboardContext();
3728
return (
3829
<div
3930
onClick={(e) => e.stopPropagation()}
@@ -72,22 +63,22 @@ export const FoldersDropdown = ({
7263
},
7364
},
7465
// Only show Duplicate if there is NO active space
75-
...(!activeSpace
76-
? [
77-
{
78-
label: "Duplicate",
79-
icon: faCopy,
80-
onClick: async () => {
81-
try {
82-
await duplicateFolder(id, parentId);
83-
toast.success("Folder duplicated successfully");
84-
} catch (error) {
85-
toast.error("Failed to duplicate folder");
86-
}
87-
},
88-
},
89-
]
90-
: []),
66+
// ...(!activeSpace
67+
// ? [
68+
// {
69+
// label: "Duplicate",
70+
// icon: faCopy,
71+
// onClick: async () => {
72+
// try {
73+
// await duplicateFolder(id, parentId);
74+
// toast.success("Folder duplicated successfully");
75+
// } catch (error) {
76+
// toast.error("Failed to duplicate folder");
77+
// }
78+
// },
79+
// },
80+
// ]
81+
// : []),
9182
{
9283
label: "Delete",
9384
icon: faTrash,

0 commit comments

Comments
 (0)