kopia lustrzana https://github.com/Tldraw/Tldraw
19 wiersze
390 B
TypeScript
19 wiersze
390 B
TypeScript
import { usePresence } from 'tldraw'
|
|
|
|
export function PeopleMenuAvatar({ userId }: { userId: string }) {
|
|
const presence = usePresence(userId)
|
|
|
|
if (!presence) return null
|
|
return (
|
|
<div
|
|
className="tlui-people-menu__avatar"
|
|
key={userId}
|
|
style={{
|
|
backgroundColor: presence.color,
|
|
}}
|
|
>
|
|
{presence.userName === 'New User' ? '' : presence.userName[0] ?? ''}
|
|
</div>
|
|
)
|
|
}
|