
import { View } from '@tarojs/components'
import style from './index.module.less'
import PersonalCard from '../personal-card'
import MessageRobotPlain from '@/components/chat-message/MessageRobotPlain'
import { TAgentDetail } from '@/types/agent';
interface IProps {
  agent: TAgentDetail | null;
}
export default ({agent}: IProps)=> {

  if(!agent){
    return <></>
  }

  let greeting = ''
  // 默认打招呼文案
  if(!agent.greeting){
    greeting = `Hi～ 你好我是${agent.name}`
  }else{
    // 用户自定义文案
    greeting = agent.greeting
  }

  // 3个引导提问提示词
  const questions = agent.questionGuides ?? []
  
  return (
    <View className='pt-118'>
    <View className={style.container}>
        <View className='mb-24'>
          <PersonalCard agent={agent} />
        </View>
        <View className='flex flex-col gap-8'>
          <MessageRobotPlain text={greeting}/>
          {questions.map(q => {
            return <MessageRobotPlain text={q} />
          })}
        </View>
    </View> 
   </View>
  )
}