| 1 | "use client"; |
| 2 | |
| 3 | import { useCollab } from "./collab-provider"; |
| 4 | |
| 5 | export function PresenceBar() { |
| 6 | const { users } = useCollab(); |
| 7 | const userList = Object.values(users); |
| 8 | if (userList.length === 0) return null; |
| 9 | |
| 10 | return ( |
| 11 | <div className="flex items-center gap-1"> |
| 12 | {userList.map((u) => ( |
| 13 | <span |
| 14 | key={u.id} |
| 15 | title={u.name} |
| 16 | className="flex items-center justify-center text-xs font-medium" |
| 17 | style={{ |
| 18 | width: "1.75rem", |
| 19 | height: "1.75rem", |
| 20 | borderRadius: "9999px", |
| 21 | backgroundColor: u.color, |
| 22 | color: "#fff", |
| 23 | }} |
| 24 | > |
| 25 | {u.name.charAt(0).toUpperCase()} |
| 26 | </span> |
| 27 | ))} |
| 28 | </div> |
| 29 | ); |
| 30 | } |
| 31 | |