import React from "react"; import { useTranslation } from "react-i18next"; import { useChatContext } from "@/lib/context"; import { ChatMessage } from "./components/ChatMessage/components/ChatMessage"; import { useChatMessages } from "./hooks/useChatMessages"; export const ChatMessages = (): JSX.Element => { const { history } = useChatContext(); const { t } = useTranslation(["chat"]); const { chatListRef } = useChatMessages(); return (
{history.length === 0 ? (
{t("ask", { ns: "chat" })}
) : (
{history.map( ({ assistant, message_id, user_message, brain_name, prompt_title, }) => ( ) )}
)}
); };