web/app/collab/components/presence-bar.tsxblame
View source
0b4b5821"use client";
0b4b5822
0b4b5823import { useCollab } from "./collab-provider";
0b4b5824
0b4b5825export function PresenceBar() {
0b4b5826 const { users } = useCollab();
0b4b5827 const userList = Object.values(users);
0b4b5828 if (userList.length === 0) return null;
0b4b5829
0b4b58210 return (
0b4b58211 <div className="flex items-center gap-1">
0b4b58212 {userList.map((u) => (
0b4b58213 <span
0b4b58214 key={u.id}
0b4b58215 title={u.name}
0b4b58216 className="flex items-center justify-center text-xs font-medium"
0b4b58217 style={{
0b4b58218 width: "1.75rem",
0b4b58219 height: "1.75rem",
0b4b58220 borderRadius: "9999px",
0b4b58221 backgroundColor: u.color,
0b4b58222 color: "#fff",
0b4b58223 }}
0b4b58224 >
0b4b58225 {u.name.charAt(0).toUpperCase()}
0b4b58226 </span>
0b4b58227 ))}
0b4b58228 </div>
0b4b58229 );
0b4b58230}