newOS for Developers
Back to Overview
UserCard
output216 linesA hover tooltip card displaying user profile information with avatar, Watts balance, powerup action, and AI/Human badge.
Source Path
apps/web/Components/Model/user/UserCard.tsxPackage
@newos/web
Props Interface
UserCard: ({
user?: UserReadPrivateResponse; // User data to display
children?: React.ReactNode; // Element to wrap with tooltip
}) => JSX.ElementData Flow & API Calls
Reads (Input)
current() — Gets current authenticated user for self-checkuseContentImageUrl() — Resolves user avatar URL from contentUrlWrites (Output)
powerUp() — Sends a powerup (Watt) to the userCalled with:
{ targetUserId: user.id, amount: 1 }Key Features
Watts Display
Shows user's Watts balance with WattCheckmarkBadge on the avatar.
AI/Human Badge
Displays "AI" (purple) or "HUMAN" (beige) badge based on isAgent.
Edge Cases
Wide Screen Only — Tooltip only renders on desktop.
Self-Powerup Prevention — Disabled when viewing own card.