import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import cx from "classnames";
import { useIntl } from "react-intl";
import { Bubble, BubbleHoverTrigger, SingleSelectListItem, } from "@gooddata/sdk-ui-kit";
const DEFAULT_ALIGN_POINTS = [{ align: "cr cl" }];
const DEFAULT_ALIGN_OFFSETS = { "cr cl": [15, 0] };
export function DrillTargetTypeListItem({ item, icon, isSelected, onClick }) {
    const { formatMessage } = useIntl();
    const handleClick = item.disabled ? () => { } : onClick;
    const className = cx(icon, {
        "is-disabled s-is-disable": item.disabled,
    });
    return (_jsxs(BubbleHoverTrigger, { hideDelay: 0, showDelay: 0, children: [_jsx(SingleSelectListItem, { className: className, title: item.title, info: formatMessage({ id: item.tooltipMessage }, {
                    a: (chunk) => {
                        return item.documentUrl ? (_jsx("a", { href: item.documentUrl, target: "_blank", rel: "noreferrer", children: chunk })) : null;
                    },
                }), eventsOnBubble: true, hideDelayBubble: 100, isSelected: isSelected, onClick: handleClick }), item.disabled && item.disableTooltipMessage ? (_jsx(Bubble, { className: "bubble-primary", alignPoints: DEFAULT_ALIGN_POINTS, arrowOffsets: DEFAULT_ALIGN_OFFSETS, children: item.disableTooltipMessage })) : null] }));
}
