
import { EChatRole, TChatRole, TMessage } from "@/types/bot";
import Message from "./Message";
import MessageRobot from "./MessageRobot";
import { TAgentDetail } from "@/types/agent";
interface Props {
  agent?: TAgentDetail|null,
  role: TChatRole,
  text: string|Record<string, any>
  textReasoning?: string
  message: TMessage
  mutate: (func:any, params: any)=>void
}
export default ({agent, text, role, message, mutate, textReasoning=''}:Props) => {
  if(role === EChatRole.User ){
    return <Message text={text as string}/>
  }
  return <MessageRobot mutate={mutate} message={message} textReasoning={textReasoning} text={text as string} agent={agent}/>
}


