Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.
Mirrored from https://github.com/Camo67/composio.git
Synced Nov 21, 06:00 UTC
| 1 | import { notFound, permanentRedirect } from 'next/navigation'; |
| 2 | import { getKbLegacySegments, resolveKbAlias } from '@/lib/kb/repository'; |
| 3 | |
| 4 | interface LegacyKnowledgeBasePageProps { |
| 5 | params: Promise<{ legacy: string[] }>; |
| 6 | } |
| 7 | |
| 8 | export default async function LegacyKnowledgeBasePage({ params }: LegacyKnowledgeBasePageProps) { |
| 9 | const { legacy } = await params; |
| 10 | const requestedPath = `/kb/${legacy.join('/')}`; |
| 11 | const canonical = resolveKbAlias(requestedPath); |
| 12 | if (canonical && canonical !== requestedPath) permanentRedirect(canonical); |
| 13 | notFound(); |
| 14 | } |
| 15 | |
| 16 | export function generateStaticParams() { |
| 17 | return getKbLegacySegments().map((legacy) => ({ legacy })); |
| 18 | } |