synapse-react-client
Version:
[](https://badge.fury.io/js/synapse-react-client) [](https://github.com/prettier/prettie
71 lines (70 loc) • 1.85 kB
JavaScript
import { jsx as t, Fragment as f, jsxs as l } from "react/jsx-runtime";
import { Button as c, Box as a } from "@mui/material";
import d from "../IconSvg/IconSvg.js";
import p, { useLastLoginInfo as L } from "./LastLoginInfo.js";
import { getLoginMethodFriendlyName as I } from "./LoginMethod.js";
const h = {
color: "grey.800",
mb: "10px"
}, x = {
width: "28px",
height: "28px"
};
function j(u) {
const { loginMethod: n, iconName: o, onClick: i } = u, { lastLoginMethod: e, ...g } = L(), s = p({
lastLoginMethod: e,
display: "sentence",
...g
}), m = e === n && s, r = `Sign in with ${I(n)}`;
return /* @__PURE__ */ t(f, { children: m ? /* @__PURE__ */ t(
c,
{
fullWidth: !0,
variant: "outlined",
onClick: i,
sx: { ...h, height: "74px", py: 1.5 },
"data-testid": "button-with-last-login-info",
children: /* @__PURE__ */ l(
a,
{
sx: {
flexDirection: "column"
},
children: [
/* @__PURE__ */ l(
a,
{
sx: {
display: "flex",
justifyContent: "center",
alignItems: "center",
mb: "10px"
},
children: [
o && /* @__PURE__ */ t(d, { icon: o, sx: { ...x, mr: 1, ml: -0.5 } }),
r
]
}
),
s
]
}
)
}
) : /* @__PURE__ */ t(
c,
{
fullWidth: !0,
variant: "outlined",
onClick: i,
sx: { ...h, height: "50px" },
startIcon: o && /* @__PURE__ */ t(d, { icon: o, sx: x }),
"data-testid": "button-without-last-login-info",
children: r
}
) });
}
export {
j as default
};
//# sourceMappingURL=LoginMethodButton.js.map