synapse-react-client
Version:
[](https://badge.fury.io/js/synapse-react-client) [](https://github.com/prettier/prettie
72 lines (71 loc) • 3.33 kB
JavaScript
import { jsxs as e, jsx as r } from "react/jsx-runtime";
import p from "../IconSvg/IconSvg.js";
import "../../utils/functions/EntityTypeUtils.js";
import "react";
import "../../assets/icons/chart2.svg.js";
import "../../assets/icons/Data2.svg.js";
import "../../assets/icons/DNA_Two.svg.js";
import "../../assets/icons/file.svg.js";
import "../../assets/icons/institution.svg.js";
import "../../assets/icons/mouse.svg.js";
import "../../assets/icons/organizations.svg.js";
import "../../assets/icons/person.svg.js";
import "../../assets/icons/study-active.svg.js";
import "../../assets/icons/study-complete.svg.js";
import "../../assets/icons/translational.svg.js";
import "../../assets/icons/tree_horizontal.svg.js";
import "../../assets/icons/standardDataModel.svg.js";
import "../../assets/icons/Challenge.svg.js";
import "@mui/material/SvgIcon";
import "../../utils/SynapseConstants.js";
import h from "../ShowMore/ShowMore.js";
import { Skeleton as d, Link as u } from "@mui/material";
import { SkeletonTable as N } from "../Skeleton/SkeletonTable.js";
import { UserBadge as O } from "../UserCard/UserBadge.js";
function H({
data: i,
schema: t,
includePortalCardClass: c = !0
}) {
const l = i[t.observationSubmitterName], o = i[t.synapseId], s = i[t.observationTime], v = i[t.observationTimeUnits], n = i[t.observationText], a = i[t.observationType], b = JSON.parse(a ?? ""), m = i[t.doi];
return /* @__PURE__ */ e(
"div",
{
className: `ObservationCard ${c ? "SRC-portalCard" : ""}`,
children: [
/* @__PURE__ */ e("div", { className: "ObservationCard__submitter", children: [
!o && /* @__PURE__ */ r("div", { children: l }),
o && /* @__PURE__ */ r(O, { userId: o })
] }),
s && /* @__PURE__ */ e("div", { className: "ObservationCard__time", children: [
/* @__PURE__ */ r(p, { icon: "time" }),
/* @__PURE__ */ r("span", { children: `${s} ${v}` })
] }),
n && /* @__PURE__ */ r("div", { className: "ObservationCard__text", children: /* @__PURE__ */ r(h, { summary: n }) }),
m && /* @__PURE__ */ r("div", { className: "ObservationCard__doi", children: /* @__PURE__ */ r(u, { href: m, target: "_blank", children: "Reference" }) }),
/* @__PURE__ */ r("div", { className: "ObservationCard__tags", children: a && b.map((C, _) => /* @__PURE__ */ r(
"span",
{
className: "SRC-tag",
style: { marginRight: "5px" },
children: C
},
_
)) })
]
}
);
}
function K() {
return /* @__PURE__ */ e("div", { className: "SRC-portalCard ObservationCard", children: [
/* @__PURE__ */ r("div", { className: "ObservationCard__submitter", children: /* @__PURE__ */ r("span", { children: /* @__PURE__ */ r(d, { width: "100px" }) }) }),
/* @__PURE__ */ r("div", { className: "ObservationCard__time", children: /* @__PURE__ */ r(p, { icon: "time" }) }),
/* @__PURE__ */ r("div", { className: "ObservationCard__text", children: /* @__PURE__ */ r(N, { numCols: 1, numRows: 4 }) }),
/* @__PURE__ */ r("div", { className: "ObservationCard__tags", children: /* @__PURE__ */ r(d, { width: "80px" }) })
] });
}
export {
K as LoadingObservationCard,
H as ObservationCard
};
//# sourceMappingURL=ObservationCard.js.map