import { View, Image } from "@tarojs/components";
import style from "./index.module.less";
import Taro from "@tarojs/taro";

import { getAgents, getAgent, createAgent, } from "@/service/agent";

import { isSuccess } from "@/utils";
import { useAgentStore } from "@/store/agentStore";
interface IProps {
  // children: JSX.Element|JSX.Element[]
}
export default function Index({}: IProps) {  
  const { createAgent } = useAgentStore()
  const handleCreate = async ()=> {
    createAgent()
  }
  return (
    <View className={style.container}>
      <View className={style.demoAvatar}>
        <Image className={style.demoAvatar} src="https://cdn.wehome.cn/cmn/png/159/META-H8UKWHWU-8HXWA0PE7HXUV4QMQUBV2-EHO2AUCM-HC.png" mode="widthFix"></Image>
      </View>
      <View className={style.content}>
        <View className={style.welcomBar}>
          <View className={style.hello}>你好！</View>      
          <View className={style.welcome}>欢迎你，体验「小蓝本智能体」</View>
        </View>
        <View className={style.box}>
          <View className={style.boxInner}>
            <View className={style.headline}>
              <View>开启你的专属 AI 分身，</View>
              <View>让客户随时随地了解你和你的解决方案。</View>
            </View>
            <View className={style.list}>
                <View className="flex items-center gap-6">
                  <View>企业 + 个人资料统一管理</View>
                </View>
                <View className="flex items-center gap-6">
                  <View>客户问题，AI 自动回应</View>
                </View>
                <View className="flex items-center gap-6">
                  <View>你的内容，一页呈现</View>
                </View>
            </View>
          </View>
          <View className="button-rounded-big" onClick={handleCreate}>创建智能体</View>
        </View>
      </View>
      </View>
  );
}
