({ presence }: { presence: Presence | null })
| 4 | const MAX_AVATARS = 4 // header avatars shown before "+N" |
| 5 | |
| 6 | export function PresenceStack({ presence }: { presence: Presence | null }) { |
| 7 | const users = presence?.users ?? [] |
| 8 | const total = presence?.count ?? users.length |
| 9 | const shown = users.slice(0, MAX_AVATARS) |
| 10 | const extra = total - shown.length |
| 11 | |
| 12 | return ( |
| 13 | <div className="avatar-stack" aria-hidden="true"> |
| 14 | {shown.map((u) => ( |
| 15 | <Avatar key={u.clientId} name={u.username} id={u.clientId} /> |
| 16 | ))} |
| 17 | {extra > 0 && <span className="more">+{extra}</span>} |
| 18 | </div> |
| 19 | ) |
| 20 | } |
nothing calls this directly
no outgoing calls
no test coverage detected