"use client" import { colorClasses, colors } from "@/lib/colors" import { useOthers } from "@/liveblocks.config" import { useState } from "react" export function Avatars() { const users = useOthers() const colorNames = Object.keys(colors) const [activeColors, setActiveColors] = useState([]) return (
{users.map(({ connectionId, info }) => { const c = colorNames[ connectionId % colorNames.length ] as keyof typeof colors return (
{info.name .split(" ") .slice(0, 2) .map((letter) => letter[0].toUpperCase())}
) })}
) }