Skip to content

Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.

659 B
Raw Blame
import { notFound, permanentRedirect } from 'next/navigation';
import { getKbLegacySegments, resolveKbAlias } from '@/lib/kb/repository';

interface LegacyKnowledgeBasePageProps {
  params: Promise<{ legacy: string[] }>;
}

export default async function LegacyKnowledgeBasePage({ params }: LegacyKnowledgeBasePageProps) {
  const { legacy } = await params;
  const requestedPath = `/kb/${legacy.join('/')}`;
  const canonical = resolveKbAlias(requestedPath);
  if (canonical && canonical !== requestedPath) permanentRedirect(canonical);
  notFound();
}

export function generateStaticParams() {
  return getKbLegacySegments().map((legacy) => ({ legacy }));
}