import { useApp } from '../context/AppContext' import { colorToCss } from '../utils/color' export default function ConnectionItem({ conn }) { const { state, selectConnection, userId } = useApp() const otherId = conn.requestorId === userId ? conn.recipientId : conn.requestorId const other = state.userMap[otherId] const unread = state.unread[conn.id] || 0 const isSelected = state.selectedId === conn.id const isFriend = conn.state === 1 return ( ) }