import { useTranslation } from "react-i18next"; import { Button, Dropdown, DropdownItem, KebabToggle, ToolbarItem, } from "@patternfly/react-core"; import { useSubGroups } from "../SubGroupsContext"; import { useAccess } from "../../context/access/Access"; import useToggle from "../../utils/useToggle"; type GroupToolbarProps = { toggleCreate: () => void; toggleDelete: () => void; kebabDisabled: boolean; }; export const GroupToolbar = ({ toggleCreate, toggleDelete, kebabDisabled, }: GroupToolbarProps) => { const { t } = useTranslation("groups"); const { currentGroup } = useSubGroups(); const { hasAccess } = useAccess(); const isManager = hasAccess("manage-users") || currentGroup()?.access?.manage; const [openKebab, toggleKebab] = useToggle(); if (!isManager) return
; return ( <>