'use client'; import { cn } from '@/lib/utils'; interface TypingIndicatorProps { roomType?: string; typers: Array<{ userId: string; userName: string }>; className?: string; } function isGroupRoomType(type?: string) { return type === 'GROUP' || type === 'GENERAL'; } export function TypingIndicator({ roomType, typers, className }: TypingIndicatorProps) { if (!typers.length) return null; const group = isGroupRoomType(roomType); let label = 'печатает'; if (group) { if (typers.length === 1) { label = `${typers[0]!.userName} печатает`; } else if (typers.length === 2) { label = `${typers[0]!.userName} и ${typers[1]!.userName} печатают`; } else { label = `${typers.length} участника печатают`; } } return (