import { useMemo } from 'react';
export function useStepActions(step, index, onEdit, onDelete, onDuplicate, onSelect) {
    return useMemo(()=>{
        const actionsList = [];
        if (onSelect) {
            actionsList.push({
                iconProps: iconProps.preview,
                onClick: ()=>onSelect(step?.id),
                title: 'Preview table'
            });
        }
        if (onEdit) {
            actionsList.push({
                iconProps: iconProps.edit,
                onClick: ()=>onEdit(step, index),
                title: 'Edit step'
            });
        }
        if (onDuplicate) {
            actionsList.push({
                iconProps: iconProps.duplicate,
                onClick: ()=>onDuplicate(step),
                title: 'Duplicate step'
            });
        }
        if (onDelete) {
            actionsList.push({
                iconProps: iconProps.delete,
                onClick: ()=>onDelete?.(index),
                title: 'Delete step'
            });
        }
        return actionsList;
    }, [
        step,
        index,
        onEdit,
        onDelete,
        onDuplicate,
        onSelect
    ]);
}
const iconProps = {
    preview: {
        iconName: 'View'
    },
    edit: {
        iconName: 'Edit'
    },
    duplicate: {
        iconName: 'DuplicateRow'
    },
    delete: {
        iconName: 'Delete'
    }
};
