synapse-react-client
Version:
[](https://badge.fury.io/js/synapse-react-client) [](https://github.com/prettier/prettie
45 lines (44 loc) • 1.37 kB
JavaScript
import { jsxs as d, jsx as l } from "react/jsx-runtime";
import { PRODUCTION_ENDPOINT_CONFIG as u } from "../utils/functions/getEndpoint.js";
import { useGetRealmPrincipals as T } from "../synapse-queries/realm/useRealmPrincipals.js";
import { Box as f, Link as I } from "@mui/material";
import P from "./IconSvg/IconSvg.js";
const g = "All registered Synapse users", _ = "Anyone on the web";
function S(a) {
const { teamId: i, openLinkInNewTab: c } = a;
let { teamName: t, disableHref: e } = a;
const { data: m } = T(), p = m || {}, {
authenticatedUsers: r,
publicGroup: o
} = p;
let n = "team";
const s = String(i);
return r && s === r && (n = "public", t = g, e = !0), o && s === o && (n = "public", t = _, e = !0), /* @__PURE__ */ d(
f,
{
component: "span",
sx: {
display: "inline-flex",
alignItems: "center"
},
children: [
/* @__PURE__ */ l(P, { icon: n, fontSize: "small" }),
/* @__PURE__ */ l(
e ? "span" : I,
{
style: { marginLeft: "5px" },
href: e ? void 0 : `${u.PORTAL}Team:${i}`,
target: c ? "_blank" : "",
children: t
}
)
]
}
);
}
export {
g as AUTHENTICATED_GROUP_DISPLAY_TEXT,
_ as PUBLIC_GROUP_DISPLAY_TEXT,
S as default
};
//# sourceMappingURL=TeamBadge.js.map