import { Button } from '@wix/design-system';
import React, { forwardRef, useCallback } from 'react';
import { DisabledTooltip } from '../DisabledTooltip';
export const BulkActionButton = forwardRef((props, ref) => {
    const { tooltipText, tooltipProps, ...rest } = props;
    const setRef = useCallback((element) => {
        if (!ref) {
            return;
        }
        const buttonEl = element?.querySelector('button') ?? null;
        if (typeof ref === 'function') {
            ref(buttonEl);
        }
        else {
            ref.current =
                buttonEl;
        }
    }, [ref]);
    return (React.createElement("div", { ref: setRef, style: { display: 'contents' } },
        React.createElement(DisabledTooltip, { content: tooltipText, dataHook: "bulk-action-button-tooltip", ...tooltipProps },
            React.createElement(Button, { dataHook: "bulk-action-button", skin: "standard", priority: "secondary", ...rest }))));
});
BulkActionButton.displayName = 'BulkActionButton';
//# sourceMappingURL=BulkActionButton.js.map