diff --git a/src/components/auth/UserMenu.tsx b/src/components/auth/UserMenu.tsx new file mode 100644 index 0000000..a6ad75e --- /dev/null +++ b/src/components/auth/UserMenu.tsx @@ -0,0 +1,85 @@ +import { useState } from 'react' +import { User, LogOut, Cloud, Key } from 'lucide-react' +import { useAppStore } from '../../stores/appStore' +import { LoginModal } from './LoginModal' + +export function UserMenu() { + const { currentUser, logout, syncStatus, syncFromCloud } = useAppStore() + const [showLogin, setShowLogin] = useState(false) + const [showActivate, setShowActivate] = useState(false) + + if (!currentUser) { + return ( + <> + + {showLogin && setShowLogin(false)} />} + + ) + } + + return ( + <> +
+
+
+
+ {currentUser.username[0].toUpperCase()} +
+ + {currentUser.username} + +
+ +
+ + {currentUser.cloudEnabled ? ( + + ) : ( + + )} +
+ + {showActivate && ( + setShowActivate(false)} /> + )} + + ) +}