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

28 lines (27 loc) 949 B
import { jsx as o } from "react/jsx-runtime"; import m from "../../synapse-queries/entity/useEntityBundle.js"; import { useResolveLinkEntity as l } from "../../utils/functions/ResolveLinkEntity.js"; import { isFileEntity as L } from "../../utils/types/IsType.js"; import { ALL_ENTITY_BUNDLE_FIELDS as u } from "@sage-bionetworks/synapse-types"; import { SynapseSpinner as f } from "../LoadingScreen/LoadingScreen.js"; import p from "./FileEntityPreview.js"; function k(t) { const { entityId: e, versionNumber: r } = t, { data: i, isLoading: s } = l(e, r), n = i && L(i), { data: d, isLoading: a } = m( i?.id, i?.versionNumber, u, { enabled: !!n, throwOnError: !0 } ); if (s || a) return /* @__PURE__ */ o(f, {}); if (n) return /* @__PURE__ */ o(p, { bundle: d }); throw new Error(`${e} is not a File and cannot be previewed.`); } export { k as default }; //# sourceMappingURL=EntityPreview.js.map