<template>
  <div class="kb-view">
    <a-tabs v-model:activeKey="activeTab">
      <a-tab-pane key="documents" tab="文档管理">
        <DocumentUpload />
      </a-tab-pane>
      <a-tab-pane key="sources" tab="信息源配置">
        <SourceConfig />
      </a-tab-pane>
      <a-tab-pane key="search" tab="检索测试">
        <SearchTest />
      </a-tab-pane>
    </a-tabs>
  </div>
</template>

<script setup lang="ts">
import { ref, onMounted } from 'vue'
import { useKnowledgeStore } from '@/stores/knowledge'
import DocumentUpload from '@/components/kb/DocumentUpload.vue'
import SourceConfig from '@/components/kb/SourceConfig.vue'
import SearchTest from '@/components/kb/SearchTest.vue'

const kbStore = useKnowledgeStore()
const activeTab = ref('documents')

onMounted(() => {
  kbStore.fetchSources()
})
</script>

<style scoped>
.kb-view {
  height: 100%;
  padding: 16px 24px;
  overflow-y: auto;
  background: #fff;
}
</style>
