import { MessageList } from './MessageList'
import { MessageInput } from './MessageInput'
import type { ChatMessage } from '../../types/protocol'

interface ChatContainerProps {
  messages: ChatMessage[]
  isLoading: boolean
  isReadOnly?: boolean
  channelName?: string
  onSendMessage: (content: string) => void
  onNavigateToSubAgent?: (taskId: string, description: string) => void
}

export function ChatContainer({
  messages,
  isLoading,
  isReadOnly = false,
  channelName,
  onSendMessage,
  onNavigateToSubAgent,
}: ChatContainerProps) {
  return (
    <div className="flex h-full flex-col">
      <div className="flex-1 overflow-hidden">
        <MessageList messages={messages} onNavigateToSubAgent={onNavigateToSubAgent} />
      </div>
      <MessageInput
        onSend={onSendMessage}
        disabled={isLoading}
        isReadOnly={isReadOnly}
        channelName={channelName}
      />
    </div>
  )
}
