import type { UiMessage } from '@/contexts'; import { MessageList } from '@/components/ui/message-list'; import { MessageInput } from '@/components/ui/message-input'; import { convertMessagesToShadcn } from './chatbotKitAdapter'; import { memo, useRef } from 'react'; import { cn } from '@/lib/utils'; interface RoomChatInterfaceProps { messages: UiMessage[]; input: string; onInputChange: (e: React.ChangeEvent) => void; onSubmit: (e: React.FormEvent) => void; isGenerating?: boolean; className?: string; } export const RoomChatInterface = memo(function RoomChatInterface({ messages, input, onInputChange, onSubmit, isGenerating = false, className, }: RoomChatInterfaceProps) { const messagesEndRef = useRef(null); const shadcnMessages = convertMessagesToShadcn(messages); const lastMessage = messages[messages.length - 1]; const isTyping = lastMessage?.sender_type === 'user' && isGenerating; return (
{messages.length === 0 ? (

No messages yet

Start a conversation below

) : ( )}
); });