From 38e3731111e9c9340d0e41c7ac449a9ef2276ad8 Mon Sep 17 00:00:00 2001 From: Emir Karabeg Date: Wed, 29 Jan 2025 21:29:40 -0800 Subject: [PATCH] Added duplicate block function --- .../components/action-bar/action-bar.tsx | 17 +++++++- stores/workflow/types.ts | 1 + stores/workflow/workflow-store.ts | 41 +++++++++++++++++++ 3 files changed, 58 insertions(+), 1 deletion(-) diff --git a/app/w/components/workflow-block/components/action-bar/action-bar.tsx b/app/w/components/workflow-block/components/action-bar/action-bar.tsx index 8422cba5b4..da057c2f77 100644 --- a/app/w/components/workflow-block/components/action-bar/action-bar.tsx +++ b/app/w/components/workflow-block/components/action-bar/action-bar.tsx @@ -1,5 +1,5 @@ import { Button } from '@/components/ui/button' -import { Trash2, Play, Circle, CircleOff } from 'lucide-react' +import { Trash2, Play, Circle, CircleOff, Copy } from 'lucide-react' import { useWorkflowStore } from '@/stores/workflow/workflow-store' import { Tooltip, @@ -16,6 +16,7 @@ export function ActionBar({ blockId }: ActionBarProps) { const toggleBlockEnabled = useWorkflowStore( (state) => state.toggleBlockEnabled ) + const duplicateBlock = useWorkflowStore((state) => state.duplicateBlock) const isEnabled = useWorkflowStore( (state) => state.blocks[blockId]?.enabled ?? true ) @@ -36,6 +37,20 @@ export function ActionBar({ blockId }: ActionBarProps) { Delete Block + + + + + Duplicate Block + +