import MessageList from "@/components/MessageList"
import SenderBox from "@/components/SenderBox"
import { useEffect } from "react"
import { observer, useStore } from "@/stores/utils"
const Exam = () => {
  const { ExamStore } = useStore()
  const {
    botInfo,
    streamingChat,
    messageList,
    deleteMessage,
    reGenerate,
    chatId,
    isLoading,
    abortChat,
    containerRef,
    conversationID,
    scrollToBottom,
    handleUploadFile,
    uploading,
    getBotInfo,
    fileArr,
    onRemoveFile,
  } = ExamStore

  useEffect(() => {
    getBotInfo()
  }, [])
  return (
    <div className="flex_column page_height">
      <MessageList
        showUserInfo
        botInfo={botInfo}
        streamingChat={streamingChat}
        messageList={messageList}
        deleteMessage={deleteMessage}
        reGenerate={reGenerate}
        chatId={chatId}
        isLoading={isLoading}
        abortChat={abortChat}
        containerRef={containerRef}
        conversationID={conversationID}
        scrollToBottom={scrollToBottom}
      />
      <SenderBox
        streamingChat={streamingChat}
        isLoading={isLoading}
        abortChat={abortChat}
        handleUploadFile={handleUploadFile}
        scrollToBottom={scrollToBottom}
        uploading={uploading}
        fileArr={fileArr}
        onRemoveFile={onRemoveFile}
      />
    </div>
  )
}

export default observer(Exam)
