mirror of
https://github.com/langgenius/dify.git
synced 2026-07-30 00:39:34 +08:00
13 lines
371 B
TypeScript
13 lines
371 B
TypeScript
import type { AgentDetailSectionKey } from './section'
|
|
|
|
export const getAgentDetailPath = (agentId: string, section: AgentDetailSectionKey) =>
|
|
`/agents/${agentId}/${section}`
|
|
|
|
export const getAgentIdFromPathname = (pathname: string) => {
|
|
const [section, agentId] = pathname.split('/').filter(Boolean)
|
|
|
|
if (section !== 'agents') return undefined
|
|
|
|
return agentId
|
|
}
|