import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
// (C) 2023-2025 GoodData Corporation
import cx from "classnames";
import { useIntl } from "react-intl";
import { messages } from "../locales.js";
import { RemoveIcon } from "../RemoveIcon.js";
function GranteeGroupIcon() {
    return (_jsx("div", { className: "gd-grantee-item-icon-left-background", children: _jsx("span", { className: "gd-grantee-item-icon gd-grantee-icon-group gd-grantee-item-icon-left" }) }));
}
export function UserGroupItem({ mode, onDelete, userGroup, isDeleteDisabled }) {
    const itemClassName = cx("s-user-management-item", "gd-share-dialog-grantee-item");
    const intl = useIntl();
    const tooltipMessage = mode === "VIEW"
        ? intl.formatMessage(isDeleteDisabled
            ? messages.removeSavedUserGroupDisabledTooltip
            : messages.removeSavedUserGroupTooltip)
        : intl.formatMessage(messages.removeUnsavedUserGroupTooltip);
    return (_jsxs("div", { className: itemClassName, children: [_jsx(RemoveIcon, { tooltipMessage: tooltipMessage, onClick: () => onDelete(userGroup), isDisabled: isDeleteDisabled }), _jsx("div", { className: "gd-grantee-content", children: _jsx("div", { className: "gd-grantee-content-label", children: userGroup.title }) }), _jsx(GranteeGroupIcon, {})] }));
}
//# sourceMappingURL=UserGroupItem.js.map