import { Button, Card, Input, Space, Typography } from '@arco-design/web-react'
import {
IconArrowUp,
IconAttachment,
IconPlusCircle,
IconRobot,
} from '@arco-design/web-react/icon'
import type { AISession, ProjectWorkspace } from './project-types'
const { Title, Text } = Typography
export function ProjectAi({ activeWorkspace, onSelectItem }: { activeWorkspace: ProjectWorkspace; onSelectItem: (title: string) => void }) {
const { aiSessions, project } = activeWorkspace
const groupedSessions = groupSessions(aiSessions)
return (
AI智能体
{project.name} 的项目内智能体工作台,选择专家后开始上下文对话。
}>
开启新对话
{groupedSessions.length ? (
groupedSessions.map((group) => (
{group.label}
{group.items.map((session, index) => (
))}
))
) : (
暂无对话
)}
选择专家,开始对话
}>
DeepSeek V4.0 Flash
} />
} />
)
}
function groupSessions(sessions: AISession[]) {
const labels = ['今天', '昨天', '7 天内']
return labels.map((label) => ({
label,
items: sessions.filter((session, index) => session.time.includes(label) || (!labels.some((item) => session.time.includes(item)) && labels.indexOf(label) === fallbackGroupIndex(index))),
})).filter((group) => group.items.length > 0)
}
function fallbackGroupIndex(index: number) {
if (index === 0) return 0
if (index === 1) return 1
return 2
}