Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.
Fix toolkits index page 404 - render ToolkitsLanding component
Sushmithamallesh committed
Jan 4, 2026 at 22:21 UTC
07921614f59229589ebaa1455bc49ac00d4938b1
1 file changed
+11
-2
fumadocs/app/(home)/toolkits/[[...slug]]/page.tsx
+11
-2
@@ -2,6 +2,7 @@ import { toolkitsSource } from '@/lib/source';
2
import { notFound } from 'next/navigation';
3
import { getMDXComponents } from '@/mdx-components';
4
import { ToolkitDetail } from '@/components/toolkits/toolkit-detail';
5
+import { ToolkitsLanding } from '@/components/toolkits/toolkits-landing';
6
import { readFile } from 'fs/promises';
7
import { join } from 'path';
8
import type { Metadata } from 'next';
@@ -18,6 +19,9 @@ async function getToolkits(): Promise<Toolkit[]> {
19
}
20
21
export async function generateStaticParams() {
22
+ // Index page
23
+ const indexParam = { slug: [] };
24
+
25
// MDX pages
26
const mdxParams = toolkitsSource.generateParams();
27
@@ -27,7 +31,7 @@ export async function generateStaticParams() {
31
slug: [toolkit.slug],
32
}));
33
30
- return [...mdxParams, ...jsonParams];
34
+ return [indexParam, ...mdxParams, ...jsonParams];
35
}
36
37
export async function generateMetadata({ params }: { params: Promise<{ slug?: string[] }> }): Promise<Metadata> {
@@ -68,6 +72,11 @@ export async function generateMetadata({ params }: { params: Promise<{ slug?: st
72
export default async function ToolkitsPage({ params }: { params: Promise<{ slug?: string[] }> }) {
73
const { slug } = await params;
74
75
+ // Index page - show landing with search/filter
76
+ if (!slug || slug.length === 0) {
77
+ return <ToolkitsLanding />;
78
+ }
79
+
80
// Check MDX first
81
const page = toolkitsSource.getPage(slug);
82
if (page) {
@@ -80,7 +89,7 @@ export default async function ToolkitsPage({ params }: { params: Promise<{ slug?
89
}
90
91
// Check JSON toolkit
83
- if (slug?.length === 1) {
92
+ if (slug.length === 1) {
93
const toolkitSlug = slug[0];
94
const toolkits = await getToolkits();
95
const toolkit = toolkits.find((t) => t.slug === toolkitSlug);