UNPKG

membros-react-sdk

Version:

React authentication library for Membros platform with subscription management and plan-based access control

14 lines 905 B
"use strict"; "use client"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Profile = Profile; const jsx_runtime_1 = require("react/jsx-runtime"); const AuthContext_1 = require("../AuthContext.cjs"); function Profile({ className }) { const { user, isAuthenticated } = (0, AuthContext_1.useAuth)(); if (!isAuthenticated || !user) { return null; } return ((0, jsx_runtime_1.jsxs)("div", { className: className, children: [user.picture && ((0, jsx_runtime_1.jsx)("img", { src: user.picture, alt: user.name, style: { width: 40, height: 40, borderRadius: '50%' } })), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)("h3", { children: ["Hello ", user.name] }), (0, jsx_runtime_1.jsx)("p", { children: user.email }), user.plano && (0, jsx_runtime_1.jsxs)("p", { children: ["Plan: ", user.plano] })] })] })); } //# sourceMappingURL=Profile.js.map