/*!
 * Copyright (c) Microsoft. All rights reserved.
 * Licensed under the MIT license. See LICENSE file in the project.
 */ import { useCallback } from 'react';
export function useHandleStepSave(workflow) {
    return useCallback((step, index)=>{
        const isExistingStep = index != null && workflow.length > 0 && index < workflow.length;
        return isExistingStep ? workflow.updateStep(step, index) : workflow.addStep(step);
    }, [
        workflow
    ]);
}
