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

26 lines (25 loc) 1.09 kB
import { jsx as t } from "react/jsx-runtime"; import { useSynapseContext as m } from "../../utils/context/SynapseContext.js"; import { LockOutlined as u, ErrorOutlined as d } from "@mui/icons-material"; import { Tooltip as f, Chip as h, Avatar as x } from "@mui/material"; import { SignInPrompt as E, YOU_ARE_NOT_AUTHORIZED_MESSAGE as v } from "./ErrorBanner.js"; function _(c) { const { chipText: p, error: o } = c, { isAuthenticated: n } = m(), r = (o.status === 403 || o.status === 401) && !n, i = o.status === 403 && n, s = r ? "warning" : "error"; let a, l; r || i ? a = /* @__PURE__ */ t(x, { sx: { bgcolor: `${s}.main` }, children: /* @__PURE__ */ t(u, { sx: { color: "white", width: "18px" } }) }) : l = r || i ? void 0 : /* @__PURE__ */ t(d, {}); let e; return r ? e = /* @__PURE__ */ t(E, {}) : i ? e = v : e = o.reason, /* @__PURE__ */ t(f, { title: e, children: /* @__PURE__ */ t( h, { avatar: a, color: s, variant: "outlined", icon: l, label: p } ) }); } export { _ as default }; //# sourceMappingURL=ErrorChip.js.map