import './index.css';
import { jsx, Fragment } from 'react/jsx-runtime';
import { isValidElement, cloneElement } from 'react';
import { useDisabled } from '@hh.ru/magritte-common-use-disabled';

const WrapperMockComponent = ({ 'data-qa': dataQa, disabled, tabIndex, children, ...props }) => {
    const isComponentDisabled = useDisabled() || !!disabled;
    if (props.onClick) {
        return (jsx("button", { type: 'button', "data-qa": dataQa, onClick: props.onClick, disabled: isComponentDisabled, tabIndex: tabIndex, children: isValidElement(children) ? cloneElement(children, { 'data-qa': undefined }) : children }));
    }
    return jsx(Fragment, { children: children });
};

export { WrapperMockComponent as default };
//# sourceMappingURL=WrapperMockComponent.js.map
