synapse-react-client
Version:
[](https://badge.fury.io/js/synapse-react-client) [](https://github.com/prettier/prettie
19 lines (18 loc) • 733 B
JavaScript
import { jsx as i } from "react/jsx-runtime";
import { useSynapseContext as l } from "../../utils/context/SynapseContext.js";
import { SRC_SIGN_IN_CLASS as c } from "../../utils/SynapseConstants.js";
import { Button as m } from "@mui/material";
import { Link as a } from "react-router";
function u(t) {
const { isAuthenticated: n } = l(), e = { ...t }, o = {
to: t.to,
replace: t.replace
};
delete e.to, delete e.replace, n || (delete e.href, e.className = c);
let r = /* @__PURE__ */ i(m, { ...e, children: e.children });
return n && o.to && !e.href && (r = /* @__PURE__ */ i(a, { to: o.to, replace: o.replace, children: r })), r;
}
export {
u as LoginAwareButton
};
//# sourceMappingURL=LoginAwareButton.js.map