import { View, Text } from "@tarojs/components";
import Taro, { useDidShow, useReachBottom } from "@tarojs/taro";
import VisitorCard from "../VisitorCard/index";
import eventBus, {BUS_EVENTS} from '@/utils/EventBus'
import { TVisitorAgent } from "@/types/visitor";
import { getVisitorList } from "@/service/visitor";
import { useLoadMoreInfinite, createKey } from "@/utils/loadMoreInfinite";
import { useEffect } from "react";
import EmptyData, { EmptyDataSubInfo, EmptyDataTitle } from "@/components/EmptyData";
interface IProps {
  agentId?: string;
  list: TVisitorAgent[]
}

export default ({ agentId, list }: IProps) => {


  return (
    <View className="p-16">
      <View className="mb-16 text-14 leading-22 font-medium font-pingfangSCMedium">访问详情</View>
      <View className="flex flex-col gap-8">
        {!list.length && <View className="pb-44">
          <EmptyData type='search'>
            <EmptyDataSubInfo>
              <View>当前暂无用户访问记录</View>
              <View>你的智能体正在等待首次互动</View>
            </EmptyDataSubInfo>
          </EmptyData>
        </View>}
        {list.map((item) => {
          return (
            <VisitorCard
              data={item}
            ></VisitorCard>
          );
        })}
      </View>
    </View>
  );
};
