membros-react-sdk
Version:
React authentication library for Membros platform with subscription management and plan-based access control
14 lines • 500 B
JavaScript
"use client";
import { jsx as _jsx } from "react/jsx-runtime";
import { useAuth } from "../AuthContext.esm.js";
export function LogoutButton({ children = "Log out", className, options }) {
const { isAuthenticated, logout } = useAuth();
const handleLogout = () => {
logout(options);
};
if (!isAuthenticated) {
return null;
}
return (_jsx("button", { onClick: handleLogout, className: className, children: children }));
}
//# sourceMappingURL=LogoutButton.js.map