UNPKG

payload-authjs

Version:
30 lines (29 loc) 888 B
"use client"; import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime"; import { Button } from "@payloadcms/ui"; import { signIn } from "next-auth/react"; import "./index.css"; /** * A button to sign in with a Auth.js provider */ export const SignInButton = ({ provider, icon = /*#__PURE__*/ _jsx("img", { src: provider.icon, alt: `Provider ${provider.name}` }), text = /*#__PURE__*/ _jsxs(_Fragment, { children: [ "Sign in with ", /*#__PURE__*/ _jsx("strong", { children: provider.name }) ] }) })=>{ return /*#__PURE__*/ _jsx(Button, { className: "payload-authjs-sign-in-button", size: "large", buttonStyle: "pill", icon: icon, iconPosition: "left", onClick: ()=>signIn(provider.id), children: text }); }; //# sourceMappingURL=index.js.map