import { Children, cloneElement, isValidElement } from "react";
export const updatePropsRecursively = (children, activeIndex, view, disabled, updateValue)=>Children.map(children || [], (child, index)=>{
        if (!isValidElement(child)) {
            return child;
        }
        const props = {
            index,
            value: !!(activeIndex?.findIndex((i)=>i === (child.props.eventKey ?? index)) !== -1),
            view,
            disabled,
            onChange: updateValue
        };
        return cloneElement(child, props);
    });
export const getChildren = (children, activeIndex, view, disabled, updateValue)=>{
    return updatePropsRecursively(children, activeIndex, view, disabled, updateValue);
};
