UNPKG

naim-firebase-auth-wrapper

Version:

React components and hooks for Firebase Authentication and Firestore with Mantine UI

19 lines 731 B
'use client'; import { jsx as _jsx } from "react/jsx-runtime"; import { useAuth } from '../hooks/useAuth'; import { Button, Group } from '@mantine/core'; import { IconLogout } from '@tabler/icons-react'; export const Logout = ({ onSuccess, onError }) => { const { signOut } = useAuth(); const handleLogout = async () => { try { await signOut(); onSuccess?.(); } catch (error) { onError?.(error); } }; return (_jsx(Group, { justify: "center", children: _jsx(Button, { onClick: handleLogout, variant: "light", color: "red", radius: "md", leftSection: _jsx(IconLogout, { size: 16 }), children: "Sign Out" }) })); }; //# sourceMappingURL=Logout.js.map