import * as React from "react" import { useAppDispatch, useAutoScroll, LANGUAGE_OPTIONS, useAppSelector, GRAPH_OPTIONS, isRagGraph, } from "@/common" import { Bot, Brain, MessageCircleQuestion } from "lucide-react" import { EMessageDataType, EMessageType, type IChatItem } from "@/types" import { Avatar, AvatarFallback } from "@/components/ui/avatar" import { cn } from "@/lib/utils" export default function MessageList(props: { className?: string }) { const { className } = props const chatItems = useAppSelector((state) => state.global.chatItems) const containerRef = React.useRef(null) useAutoScroll(containerRef) return (
{chatItems.map((item, index) => { return })}
) } export function MessageItem(props: { data: IChatItem }) { const { data } = props return ( <>
{data.type === EMessageType.AGENT ? data.data_type === EMessageDataType.REASON ? ( ) : ( ) : null}
{data.data_type === EMessageDataType.IMAGE ? ( chat ) : (

{data.text}

)}
) }