From 6bd40f068a57170c26102a8340e9efeb269286c1 Mon Sep 17 00:00:00 2001 From: nomorepanic Date: Mon, 16 Sep 2024 20:42:07 +0200 Subject: [PATCH] feat: NodeControls uses duplicateViewItem --- src/components/ItemControls/NodeControls/NodeControls.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/ItemControls/NodeControls/NodeControls.tsx b/src/components/ItemControls/NodeControls/NodeControls.tsx index db1f8a2a..eb783e09 100644 --- a/src/components/ItemControls/NodeControls/NodeControls.tsx +++ b/src/components/ItemControls/NodeControls/NodeControls.tsx @@ -28,7 +28,7 @@ type Mode = keyof typeof ModeOptions; export const NodeControls = ({ id }: Props) => { const [mode, setMode] = useState('SETTINGS'); - const { updateModelItem, updateViewItem, deleteViewItem } = useScene(); + const { updateModelItem, updateViewItem, deleteViewItem, duplicateViewItem } = useScene(); const uiStateActions = useUiStateStore((state) => { return state.actions; }); @@ -101,6 +101,9 @@ export const NodeControls = ({ id }: Props) => { uiStateActions.setItemControls(null); deleteViewItem(viewItem.id); }} + onDuplicated={() => { + duplicateViewItem(viewItem); + }} /> )} {mode === 'CHANGE_ICON' && (