import { useMemo } from "react";
import { useProjectSlug } from "@contember/react-client";
import { useIdentity } from "../components/Identity/useIdentity.js";
const useProjectUserRoles = () => {
  const identity = useIdentity();
  const projectSlug = useProjectSlug();
  return useMemo(() => {
    if (!projectSlug) {
      return /* @__PURE__ */ new Set();
    }
    const targetProject = identity.projects.find((project) => project.slug === projectSlug);
    if (targetProject === void 0) {
      return /* @__PURE__ */ new Set();
    }
    return new Set(targetProject.roles);
  }, [identity.projects, projectSlug]);
};
export { useProjectUserRoles };
//# sourceMappingURL=useProjectUserRoles.js.map
