import React from 'react'; import { useAuth } from '../../context/AuthContext'; import { clearSession } from '../../lib/init'; interface ProfileProps { onLogout?: () => void; } export const Profile: React.FC = ({ onLogout }) => { const { session, updateSession } = useAuth(); const handleLogout = () => { // Clear the session clearSession(); // Update the auth context updateSession({ username: '', authed: false, backupCreated: null, }); // Call the onLogout callback if provided if (onLogout) onLogout(); }; if (!session.authed || !session.username) { return null; } return (

Welcome, {session.username}!

{!session.backupCreated && (

Remember to back up your encryption keys to prevent data loss!

)}
); };