UNPKG

synapse-react-client

Version:

[![npm version](https://badge.fury.io/js/synapse-react-client.svg)](https://badge.fury.io/js/synapse-react-client) [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettie

89 lines (88 loc) 2.74 kB
import { jsxs as e, jsx as o } from "react/jsx-runtime"; import "@sage-bionetworks/synapse-types"; import { entityTypeToFriendlyName as d, convertToEntityType as a } from "../../utils/functions/EntityTypeUtils.js"; import { getEndpoint as l, BackendDestinationEnum as s } from "../../utils/functions/getEndpoint.js"; import "../../synapse-client/SynapseClient.js"; import "@sage-bionetworks/synapse-client/generated/models/ErrorResponseCode"; import "@sage-bionetworks/synapse-client/generated/models/TwoFactorAuthErrorResponse"; import "@sage-bionetworks/synapse-client/util/SynapseClientError"; import "@sage-bionetworks/synapse-client/util/synapseClientFetch"; import "lodash-es"; import { Box as p, Typography as t, Chip as c } from "@mui/material"; import n from "dayjs"; import y from "dayjs/plugin/relativeTime"; import { UserBadge as x } from "../UserCard/UserBadge.js"; n.extend(y); function D({ entityHeader: r, isMobileView: g }) { const i = d( a(r.type) ), m = i === "Project" ? "primary" : "secondary"; return /* @__PURE__ */ e( p, { onClick: () => { window.open( `${l(s.PORTAL_ENDPOINT)}Synapse:${r.id}`, "_blank" ); }, sx: { display: "grid", borderColor: "grey.400", borderWidth: "1px", borderStyle: "solid", width: "100%", gridTemplateColumns: "80% 20%", backgroundColor: "rgba(255, 255, 255, 0.8)", "&:hover": { backgroundColor: "rgba(233, 243, 254, 0.9)", cursor: "pointer" }, p: "15px 0px" }, children: [ /* @__PURE__ */ e(p, { sx: { color: "grey.900", pl: "15px", pr: "10px" }, children: [ /* @__PURE__ */ o( t, { variant: "body1", sx: { color: "grey.900", fontSize: "16px" }, noWrap: !0, children: r.name } ), /* @__PURE__ */ e( t, { component: "span", variant: "body1", sx: { color: "grey.700" }, children: [ "Created ", n(r.createdOn).fromNow(), " by", " ", /* @__PURE__ */ o(x, { userId: r.createdBy }) ] } ) ] }), /* @__PURE__ */ o(p, { sx: { justifySelf: "end", pr: "15px", alignSelf: "start" }, children: /* @__PURE__ */ o( c, { sx: { borderRadius: "5px", height: "24px" }, label: i, color: m } ) }) ] } ); } export { D as SynapseHotDropItem }; //# sourceMappingURL=SynapseHotdropsItem.js.map