import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
// (C) 2023-2025 GoodData Corporation
import { useCallback } from "react";
import cx from "classnames";
import { useIntl } from "react-intl";
import { hierarchicalPermissionMessages } from "./locales.js";
import { QuestionMarkIcon } from "./QuestionMarkIcon.js";
export function HierarchicalPermissionDropdownItem({ isHierarchicalPermission, selectedPermission, toggleDropdown, onSelect, bubbleTextId, }) {
    const intl = useIntl();
    const handleOnChange = useCallback(() => {
        toggleDropdown();
        onSelect(isHierarchicalPermission);
    }, [isHierarchicalPermission, onSelect, toggleDropdown]);
    return (_jsxs("div", { onClick: handleOnChange, className: cx("gd-list-item", "gd-menu-item", "gd-granular-permission-select-item", "gd-user-management-permission-item", "s-user-management-permission-item", {
            "is-selected": isHierarchicalPermission === selectedPermission,
        }), children: [_jsx("div", { children: intl.formatMessage(isHierarchicalPermission
                    ? hierarchicalPermissionMessages.enabled
                    : hierarchicalPermissionMessages.disabled) }), _jsx("div", { className: "gd-user-management-help-icon-wrapper", children: _jsx(QuestionMarkIcon, { bubbleTextId: bubbleTextId }) })] }));
}
//# sourceMappingURL=HierarchicalPermissionDropdownItem.js.map