/*!
 * Copyright (c) Microsoft. All rights reserved.
 * Licensed under the MIT license. See LICENSE file in the project.
 */ import { useMemo } from 'react';
/**
 * create a parallel array of output names for the steps
 *
 * @param workflow - The workflow instance
 * @returns
 */ export function useStepOutputs(workflow, defaultOutputName) {
    const outputs = workflow.outputDefinitions;
    const steps = workflow.steps;
    return useMemo(()=>steps.map((s)=>s.id).map((id, index)=>{
            const output = outputs.find((def)=>def.node === id);
            return output?.name ?? defaultOutputName?.(index);
        }), [
        steps,
        outputs,
        defaultOutputName
    ]);
}
