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

next
tsx 41 lines 1.38 KB
Raw
1 import Link from 'next/link';
2 import { getKnowledgeDisplayDescription } from '@/lib/knowledge/display';
3
4 export interface RelatedLink {
5 title: string;
6 href: string;
7 description?: string;
8 }
9
10 /**
11 * RelatedLinks — renders in the right-hand table-of-contents rail (via the
12 * DocsPage `tableOfContent.footer` slot) when a page declares `related` links
13 * in its frontmatter. Keeps "see also" pointers out of the main content flow.
14 */
15 export function RelatedLinks({ items }: { items: RelatedLink[] }) {
16 if (!items?.length) return null;
17
18 return (
19 <div className="flex flex-col gap-2.5 border-t border-fd-border pt-4">
20 <p className="font-mono text-[11px] font-medium uppercase tracking-wide text-fd-muted-foreground">
21 Related
22 </p>
23 <ul className="flex flex-col gap-3">
24 {items.map((item) => (
25 <li key={item.href}>
26 <Link href={item.href} className="group flex flex-col gap-0.5">
27 <span className="text-sm font-medium text-fd-foreground transition-colors group-hover:text-fd-primary">
28 {item.title}
29 </span>
30 {item.description && (
31 <span className="text-xs leading-snug text-fd-muted-foreground">
32 {getKnowledgeDisplayDescription(item.description)}
33 </span>
34 )}
35 </Link>
36 </li>
37 ))}
38 </ul>
39 </div>
40 );
41 }