import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
// (C) 2021-2026 GoodData Corporation
import { Typography } from "../../../Typography/Typography.js";
import { AddUserOrGroupButton } from "./AddGranteeButton.js";
import { GranteeList } from "./GranteeList.js";
import { GranteeListLoading } from "./GranteeListLoading.js";
/**
 * @internal
 */
export function ShareGranteeContent({ isLoading, grantees, areGranularPermissionsSupported, currentUserPermissions, isSharedObjectLocked, isGranteeShareLoading, applyShareGrantOnSelect, headline, onAddGrantee, onChange, onDelete, }) {
    return (_jsxs(_Fragment, { children: [
            _jsxs("div", { className: "gd-share-dialog-grantee-content-header", children: [
                    _jsx(Typography, { tagName: "h3", children: headline }), _jsx(AddUserOrGroupButton, { onClick: onAddGrantee, isDisabled: isLoading || (!!applyShareGrantOnSelect && !!isGranteeShareLoading) })
                ] }), isLoading ? (_jsx(GranteeListLoading, {})) : (_jsx(GranteeList, { currentUserPermissions: currentUserPermissions, isSharedObjectLocked: isSharedObjectLocked, grantees: grantees, mode: "ShareGrantee", areGranularPermissionsSupported: areGranularPermissionsSupported, onChange: onChange, onDelete: onDelete, isGranteeShareLoading: isGranteeShareLoading }))] }));
}
