2024-12-25 16:14:51 +08:00
|
|
|
import { RiArrowRightLine } from '@remixicon/react'
|
2024-12-26 15:44:40 +08:00
|
|
|
import type {
|
|
|
|
AgentLogItemWithChildren,
|
|
|
|
NodeTracing,
|
|
|
|
} from '@/types/workflow'
|
2024-12-25 16:14:51 +08:00
|
|
|
|
|
|
|
type AgentLogTriggerProps = {
|
2024-12-26 15:44:40 +08:00
|
|
|
nodeInfo: NodeTracing
|
|
|
|
onShowAgentResultList: (agentLogs: AgentLogItemWithChildren[]) => void
|
2024-12-25 16:14:51 +08:00
|
|
|
}
|
|
|
|
const AgentLogTrigger = ({
|
2024-12-26 15:44:40 +08:00
|
|
|
nodeInfo,
|
|
|
|
onShowAgentResultList,
|
2024-12-25 16:14:51 +08:00
|
|
|
}: AgentLogTriggerProps) => {
|
2024-12-26 15:44:40 +08:00
|
|
|
const { agentLog } = nodeInfo
|
|
|
|
|
2024-12-25 16:14:51 +08:00
|
|
|
return (
|
|
|
|
<div className='bg-components-button-tertiary-bg rounded-[10px]'>
|
|
|
|
<div className='flex items-center px-3 pt-2 system-2xs-medium-uppercase text-text-tertiary'>
|
|
|
|
Agent strategy
|
|
|
|
</div>
|
|
|
|
<div className='flex items-center pl-3 pt-1 pr-2 pb-1.5'>
|
|
|
|
<div className='shrink-0 w-5 h-5'></div>
|
|
|
|
<div className='grow mx-0.5 px-1 system-xs-medium text-text-secondary'></div>
|
|
|
|
<div
|
|
|
|
className='shrink-0 flex items-center px-[1px] system-xs-regular-uppercase text-text-tertiary cursor-pointer'
|
2024-12-26 15:44:40 +08:00
|
|
|
onClick={() => onShowAgentResultList(agentLog || [])}
|
2024-12-25 16:14:51 +08:00
|
|
|
>
|
|
|
|
Detail
|
|
|
|
<RiArrowRightLine className='ml-0.5 w-3.5 h-3.5' />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
export default AgentLogTrigger
|