되돌리기 기능 추가

This commit is contained in:
kjs
2025-10-13 13:28:20 +09:00
parent 2849f7e116
commit 8046c2a2e0
3 changed files with 181 additions and 4 deletions

View File

@@ -25,6 +25,10 @@ export function FlowToolbar() {
isSaving,
selectedNodes,
removeNodes,
undo,
redo,
canUndo,
canRedo,
} = useFlowEditorStore();
const [showLoadDialog, setShowLoadDialog] = useState(false);
@@ -108,10 +112,10 @@ export function FlowToolbar() {
<div className="h-6 w-px bg-gray-200" />
{/* 실행 취소/다시 실행 */}
<Button variant="ghost" size="sm" title="실행 취소" disabled>
<Button variant="ghost" size="sm" title="실행 취소 (Ctrl+Z)" disabled={!canUndo()} onClick={undo}>
<Undo2 className="h-4 w-4" />
</Button>
<Button variant="ghost" size="sm" title="다시 실행" disabled>
<Button variant="ghost" size="sm" title="다시 실행 (Ctrl+Y)" disabled={!canRedo()} onClick={redo}>
<Redo2 className="h-4 w-4" />
</Button>