import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
// (C) 2026 GoodData Corporation
import cx from "classnames";
import { UiTooltip } from "@gooddata/sdk-ui-kit";
export function SelectionTypeItem({ item, itemTitle, tooltip, selected, disabled, disabledTooltip, onClick, }) {
    const className = cx("gd-list-item", "selection-kind-dropdown-item", {
        "is-selected": selected,
        "is-disabled": disabled,
    }, "s-selection-kind-dropdown-item", `s-selection-kind-dropdown-item-${item}`);
    const itemContent = (_jsxs("div", { className: className, onClick: () => !disabled && onClick(), children: [
            _jsx("span", { className: "selection-kind-dropdown-item-title", children: itemTitle }), disabled ? null : (_jsx(UiTooltip, { anchor: _jsx("span", { className: "selection-kind-dropdown-item-help gd-icon-circle-question" }), content: _jsx("span", { style: { whiteSpace: "pre-line", maxWidth: 240 }, children: tooltip }), arrowPlacement: "left", triggerBy: ["hover"], anchorWrapperStyles: { display: "flex", alignItems: "center" } }))] }));
    if (disabled && disabledTooltip) {
        return (_jsx(UiTooltip, { anchor: itemContent, content: _jsx("span", { style: { maxWidth: 240 }, children: disabledTooltip }), arrowPlacement: "left", triggerBy: ["hover"], anchorWrapperStyles: { width: "100%", height: "100%" } }));
    }
    return itemContent;
}
