<template>
  <a-layout-sider width="250" style="background: #fff">
    <div class="logo">
      <img :src="cozeInfo?.icon_url" class="agent-img" />
    </div>
    <a-menu mode="inline" theme="light">
      <a-menu-item key="1">
        <span>{{ cozeInfo.title }}</span>
        <span style="color: #8492ff; font-size: 12px">{{ cozeInfo.type == 1 ? '智能体' : '对话式' }}</span>
        <span style="float: right">{{ cozeInfo.views }}次使用</span>
      </a-menu-item>
      <a-menu-item key="2">历史对话</a-menu-item>

    </a-menu>
  </a-layout-sider>
</template>

<script lang="ts" setup>
import { defineProps } from 'vue';

const props = defineProps({
  cozeInfo: {
    type: Object as () => any,
    default: () => ({}),
  },
  botId: {
    type: String,
    default: '',
  },
});
console.log(props.cozeInfo, 'cozeInfo');
const getHistoryChat = async () => {
  const { code, data } = await getHistoryChat({ botId: props.botId });
  console.log(data, 'data');
  // 获取历史对话
};

onMounted(() => {
  getHistoryChat();
});
</script>

<style scoped>
.logo {
  margin-bottom: 20px;
}

.agent-img {
  width: 100%;
  height: 260px;
  border-radius: 4px;
}
</style>
