synapse-react-client
Version:
[](https://badge.fury.io/js/synapse-react-client) [](https://github.com/prettier/prettie
48 lines (47 loc) • 1.34 kB
JavaScript
import { jsx as t, Fragment as u } from "react/jsx-runtime";
import { entityTypeToFriendlyName as y } from "../utils/functions/EntityTypeUtils.js";
import { EntityType as e } from "@sage-bionetworks/synapse-client";
import { Fragment as f } from "react";
import s, { type2SvgIconName as d } from "./IconSvg/IconSvg.js";
const v = (r) => {
switch (r) {
case e.project:
case e.folder:
case e.file:
case e.table:
case e.link:
case e.entityview:
case e.dockerrepo:
case e.submissionview:
case e.dataset:
case e.datasetcollection:
case e.materializedview:
case e.virtualtable:
case e.recordset:
return d[r];
default:
return "";
}
};
function E(r) {
const {
type: o,
style: l,
className: m,
includeTooltip: p = !0,
wrap: n = !0,
...a
} = r;
if (!o)
return /* @__PURE__ */ t(u, {});
const i = v(o);
if (i === "")
return console.warn("Could not retrieve icon for Entity with type: ", o), /* @__PURE__ */ t(f, {});
const c = p ? y(o) : void 0;
return n ? /* @__PURE__ */ t("span", { style: l, className: m, children: /* @__PURE__ */ t(s, { icon: i, label: c, wrap: n, ...a }) }) : /* @__PURE__ */ t(s, { icon: i, label: c, wrap: n, ...a });
}
export {
E as EntityTypeIcon,
E as default
};
//# sourceMappingURL=EntityIcon.js.map