import { useAuth } from '~/.client/hooks/useAuth'; export function UserProfile({ className }: { className?: string }) { const { isAuthenticated, userInfo, isLoading } = useAuth(); if (!isAuthenticated) { return
未登录
; } if (isLoading) { return
加载中...
; } if (!userInfo) { return
无法获取用户信息
; } return (
{userInfo.picture && ( {userInfo.name )}

{userInfo.name || userInfo.username || '用户'}

{userInfo.email &&

{userInfo.email}

}
); }