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

56 lines (55 loc) 1.82 kB
import { jsx as t } from "react/jsx-runtime"; import { calculateFriendlyFileSize as m } from "../../utils/functions/calculateFriendlyFileSize.js"; import { SAGE_OFFERINGS_HELP_URL as r } from "../../utils/SynapseConstants.js"; import i from "../FullWidthAlert/FullWidthAlert.js"; const n = 0.25; function c(l) { const { usage: e, didUploadsExceedLimit: o } = l; if (e.maxAllowedFileBytes == null) return null; const s = e.maxAllowedFileBytes * (1 - n), a = e.sumFileBytes ?? 0, u = e.maxAllowedFileBytes - a; return !o && a < s ? null : e.isOverLimit ? /* @__PURE__ */ t( i, { variant: "danger", isGlobal: !1, title: "You have no data availability", description: "You do not have any remaining data within this project. In order to upload more files, you must edit your file list or upgrade your plan.", primaryButtonConfig: { text: "Learn more", href: r } } ) : o ? /* @__PURE__ */ t( i, { variant: "danger", isGlobal: !1, title: "Selected files exceed available storage", description: `This project has only ${m( u, 1 )} of storage remaining. To continue, you must upgrade your storage, or add custom storage.`, primaryButtonConfig: { text: "Learn more", href: r } } ) : /* @__PURE__ */ t( i, { variant: "warning", isGlobal: !1, title: "Warning: Your storage availability is limited", description: `Your project has less than ${n * 100}% remaining of available storage left. Upgrade your storage, or bring your own custom storage.`, primaryButtonConfig: { text: "Learn more", href: r } } ); } export { c as ProjectStorageLimitAlert }; //# sourceMappingURL=ProjectStorageLimitAlert.js.map