import React, { useState, useEffect } from 'react'; import { useNavigate } from 'react-router-dom'; import SvgIcon from '../../components/SvgIcon'; export default function NewChat() { const navigate = useNavigate(); const [knowledgeBases, setKnowledgeBases] = useState([ { id: '1', title: '产品开发知识库', description: '产品开发流程及规范说明文档', documents: 24, date: '2025-02-15', access: 'full', }, { id: '2', title: '市场分析知识库', description: '2025年Q1市场分析总结', documents: 12, date: '2025-02-10', access: 'read', }, { id: '3', title: '财务知识库', description: '月度财务分析报告', documents: 8, date: '2025-02-01', access: 'none', }, { id: '4', title: '技术架构知识库', description: '系统架构设计文档', documents: 15, date: '2025-01-20', access: 'full', }, { id: '5', title: '用户研究知识库', description: '用户调研和反馈分析', documents: 18, date: '2025-01-15', access: 'read', }, ]); const handleSelectKnowledgeBase = (knowledgeBaseId) => { // In a real app, you would create a new chat and get its ID from the API navigate(`/chat/${knowledgeBaseId}`); }; return (
{kb.description}