import type { AgentLogItemWithChildren } from '@/types/workflow' import { RiArrowLeftLine } from '@remixicon/react' import { useTranslation } from 'react-i18next' import Button from '@/app/components/base/button' import AgentLogNavMore from './agent-log-nav-more' 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('nodes.agent.strategy.label', { ns: 'workflow' })}
) } { !!mid.length && ( <>
/
) } { !!end && agentOrToolLogItemStackLength > 1 && ( <>
/
{end.label}
) }
) } export default AgentLogNav