"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ActionButton = void 0;
const tslib_1 = require("tslib");
const jsx_runtime_1 = require("react/jsx-runtime");
const react_1 = tslib_1.__importDefault(require("react"));
const uikit_1 = require("@gravity-ui/uikit");
/**
 * ActionButton component combines Button with ActionTooltip
 *
 * This component wraps a Button inside an ActionTooltip, providing
 * a convenient way to add tooltips to action buttons throughout the application.
 *
 * @param props - Component props
 * @param ref - Forwarded ref to the button element
 * @returns ActionButton component
 */
exports.ActionButton = react_1.default.forwardRef((_a, ref) => {
    var { tooltipTitle, tooltipPlacement, tooltipDisabled, tooltipOpenDelay, tooltipCloseDelay, wrapperClassName, className, children } = _a, buttonProps = tslib_1.__rest(_a, ["tooltipTitle", "tooltipPlacement", "tooltipDisabled", "tooltipOpenDelay", "tooltipCloseDelay", "wrapperClassName", "className", "children"]);
    const button = ((0, jsx_runtime_1.jsx)(uikit_1.Button, Object.assign({}, buttonProps, { ref: ref, className: className, children: children })));
    // If no tooltip props provided, return button without tooltip
    if (!tooltipTitle) {
        return button;
    }
    return ((0, jsx_runtime_1.jsx)(uikit_1.ActionTooltip, { title: tooltipTitle, placement: tooltipPlacement, disabled: tooltipDisabled, openDelay: tooltipOpenDelay, closeDelay: tooltipCloseDelay, className: wrapperClassName, children: button }));
});
exports.ActionButton.displayName = 'ActionButton';
//# sourceMappingURL=ActionButton.js.map
