2024-12-26 15:44:40 +08:00
|
|
|
import AgentLogItem from './agent-log-item'
|
2024-12-27 16:17:44 +08:00
|
|
|
import AgentLogNav from './agent-log-nav'
|
2024-12-26 15:44:40 +08:00
|
|
|
import type { AgentLogItemWithChildren } from '@/types/workflow'
|
2024-12-25 16:14:51 +08:00
|
|
|
|
|
|
|
type AgentResultPanelProps = {
|
2024-12-30 11:14:28 +08:00
|
|
|
agentOrToolLogItemStack: { id: string; label: string }[]
|
2024-12-30 10:23:03 +08:00
|
|
|
agentOrToolLogListMap: Record<string, AgentLogItemWithChildren[]>
|
2024-12-30 11:14:28 +08:00
|
|
|
onShowAgentOrToolLog: (detail?: AgentLogItemWithChildren) => void
|
2024-12-25 16:14:51 +08:00
|
|
|
}
|
|
|
|
const AgentResultPanel = ({
|
2024-12-30 11:14:28 +08:00
|
|
|
agentOrToolLogItemStack,
|
2024-12-30 10:23:03 +08:00
|
|
|
agentOrToolLogListMap,
|
|
|
|
onShowAgentOrToolLog,
|
2024-12-25 16:14:51 +08:00
|
|
|
}: AgentResultPanelProps) => {
|
2024-12-30 11:14:28 +08:00
|
|
|
const top = agentOrToolLogItemStack[agentOrToolLogItemStack.length - 1]
|
|
|
|
const list = agentOrToolLogListMap[top.id]
|
2024-12-30 10:23:03 +08:00
|
|
|
|
2024-12-25 16:14:51 +08:00
|
|
|
return (
|
|
|
|
<div className='overflow-y-auto'>
|
2024-12-30 11:14:28 +08:00
|
|
|
<AgentLogNav
|
|
|
|
agentOrToolLogItemStack={agentOrToolLogItemStack}
|
|
|
|
onShowAgentOrToolLog={onShowAgentOrToolLog}
|
|
|
|
/>
|
2024-12-26 15:44:40 +08:00
|
|
|
{
|
|
|
|
<div className='p-2'>
|
|
|
|
{
|
|
|
|
list.map(item => (
|
|
|
|
<AgentLogItem
|
|
|
|
key={item.id}
|
|
|
|
item={item}
|
2024-12-30 10:23:03 +08:00
|
|
|
onShowAgentOrToolLog={onShowAgentOrToolLog}
|
2024-12-26 15:44:40 +08:00
|
|
|
/>
|
|
|
|
))
|
|
|
|
}
|
|
|
|
</div>
|
|
|
|
}
|
2024-12-25 16:14:51 +08:00
|
|
|
</div>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
export default AgentResultPanel
|