import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
// (C) 2023-2025 GoodData Corporation
import cx from "classnames";
import { HierarchicalPermissionsDropdown } from "./HierarchicalPermissionsDropdown.js";
import { PermissionsDropdown } from "./PermissionsDropdown.js";
import { usePermissionsDropdownState } from "./usePermissionsDropdownState.js";
import { WorkspaceIcon } from "./WorkspaceIcon.js";
export function WorkspaceItem({ workspace, subjectType, onChange, onDelete, areFilterViewsEnabled, }) {
    const { isDropdownOpen, toggleDropdown } = usePermissionsDropdownState();
    const { isDropdownOpen: isHierarchicalDropdownOpen, toggleDropdown: toggleHierarchicalDropdown } = usePermissionsDropdownState();
    const itemClassName = cx("s-user-management-workspace-item", "gd-share-dialog-grantee-item", {
        "is-active": isDropdownOpen,
    });
    return (_jsxs("div", { className: itemClassName, children: [_jsx(HierarchicalPermissionsDropdown, { workspace: workspace, subjectType: subjectType, isDropdownOpen: isHierarchicalDropdownOpen, toggleDropdown: toggleHierarchicalDropdown, onChange: onChange, className: "gd-grantee-granular-permission" }), _jsx(PermissionsDropdown, { workspace: workspace, subjectType: subjectType, isDropdownOpen: isDropdownOpen, toggleDropdown: toggleDropdown, onChange: onChange, onDelete: onDelete, className: "gd-grantee-granular-permission", areFilterViewsEnabled: areFilterViewsEnabled }), _jsx("div", { className: "gd-grantee-content", children: _jsx("div", { className: "gd-grantee-content-label", children: workspace.title }) }), _jsx(WorkspaceIcon, {})] }));
}
//# sourceMappingURL=WorkspaceItem.js.map