import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
import { Tooltip, TooltipContent, TooltipTrigger, } from "../../components/ui/tooltip";
import { cn } from "../../lib/utils";
import { forwardRef } from "react";
export const SimpleIconButton = forwardRef(({ onClick, className, icon, label, disabled, size, id, selected, children, showTooltip, "data-testid": dataTestId, ...props }, ref) => {
    const buttonElement = (_jsxs("button", { ref: ref, id: id, disabled: disabled, "data-testid": dataTestId, "aria-label": label, "aria-pressed": selected, className: cn("inline-flex items-center justify-center rounded-[4px] border border-transparent text-neutral-grey-100 transition-all shrink-0", typeof icon === "string" ? icon + " p-[6px]" : "", !className?.includes("p-") && !className?.includes("px-") && !className?.includes("py-") && typeof icon !== "string" && "p-1", disabled ? "cursor-default" : "hover:border-neutral-grey-10 hover:bg-neutral-grey-5 cursor-pointer", className, disabled && "opacity-40", size === "large" ? "text-lg" : "text-xs", selected ? "bg-highlight-10 text-highlight-100" : ""), onClick: (ev) => {
            onClick(ev);
        }, ...props, children: [typeof icon !== "string" && icon, children] }));
    if (showTooltip === false) {
        return buttonElement;
    }
    return (_jsxs(Tooltip, { delayDuration: 500, children: [_jsx(TooltipTrigger, { asChild: true, children: buttonElement }), _jsx(TooltipContent, { children: label })] }));
});
SimpleIconButton.displayName = "SimpleIconButton";
//# sourceMappingURL=SimpleIconButton.js.map