import { Avatar } from '../ui/Avatar'; export interface VoiceUserRowProps { userId: string; displayName: string; avatar: string | null; avatarColor?: string; isMuted?: boolean; isDeafened?: boolean; isCameraOn?: boolean; isUnwatchedCamera?: boolean; isScreenSharing?: boolean; isServerMuted?: boolean; isServerDeafened?: boolean; isPermissionMuted?: boolean; isLocallyMuted?: boolean; isSpeaking?: boolean; size?: 'compact' | 'default'; className?: string; } export function VoiceUserRow({ userId, displayName, avatar, avatarColor, isMuted, isDeafened, isCameraOn, isUnwatchedCamera, isScreenSharing, isServerMuted, isServerDeafened, isPermissionMuted, isLocallyMuted, isSpeaking, size = 'default', className = '', }: VoiceUserRowProps) { const avatarSize = size === 'compact' ? 20 : 24; // Mic icon priority: server muted/deafened/permission muted (amber) > self-muted (danger) const showServerMicIcon = isServerMuted || isServerDeafened || isPermissionMuted; const showSelfMicIcon = !showServerMicIcon && isMuted; // Deafen icon priority: server deafened (amber) > self-deafened (danger) const showServerDeafIcon = isServerDeafened; const showSelfDeafIcon = !isServerDeafened && isDeafened; return (
{displayName} {/* Status badges */}
{/* Server muted / space deafened / permission muted — amber mic with slash */} {showServerMicIcon && ( )} {/* Server deafened — amber headphone with slash */} {showServerDeafIcon && ( )} {/* Self-muted — danger mic with slash */} {showSelfMicIcon && ( )} {/* Self-deafened — danger headphone with slash */} {showSelfDeafIcon && ( )} {/* Camera active */} {isCameraOn && ( {isUnwatchedCamera && ( )} )} {/* Screen sharing LIVE badge */} {isScreenSharing && ( LIVE )} {/* Locally muted — volume X icon */} {isLocallyMuted && ( )}
); }