import { RiArrowLeftLine } from '@remixicon/react' import { useTranslation } from 'react-i18next' import AgentLogNavMore from './agent-log-nav-more' import Button from '@/app/components/base/button' import type { AgentLogItemWithChildren } from '@/types/workflow' type AgentLogNavProps = { agentOrToolLogItemStack: AgentLogItemWithChildren[] onShowAgentOrToolLog: (detail?: AgentLogItemWithChildren) => void } const AgentLogNav = ({ agentOrToolLogItemStack, onShowAgentOrToolLog, }: AgentLogNavProps) => { const { t } = useTranslation() const agentOrToolLogItemStackLength = agentOrToolLogItemStack.length const first = agentOrToolLogItemStack[0] const mid = agentOrToolLogItemStack.slice(1, -1) const end = agentOrToolLogItemStack.at(-1) return (
/
{ agentOrToolLogItemStackLength > 1 ? ( ) : (
{t('workflow.nodes.agent.strategy.label')}
) } { !!mid.length && ( <>
/
) } { !!end && agentOrToolLogItemStackLength > 1 && ( <>
/
{end.label}
) }
) } export default AgentLogNav