import { Button, ButtonProps, TooltipProps } from '@wix/design-system'; import React, { forwardRef, useCallback } from 'react'; import { DisabledTooltip } from '../DisabledTooltip'; export type BulkActionButtonProps = ButtonProps & { tooltipText?: string; tooltipProps?: Partial; }; export const BulkActionButton = forwardRef( (props, ref) => { const { tooltipText, tooltipProps, ...rest } = props; const setRef = useCallback( (element: HTMLElement | null) => { if (!ref) { return; } const buttonEl = (element?.querySelector('button') as HTMLButtonElement | null) ?? null; if (typeof ref === 'function') { ref(buttonEl); } else { (ref as React.MutableRefObject).current = buttonEl; } }, [ref], ); return (
); }, ); BulkActionButton.displayName = 'BulkActionButton';