@@ -4,6 +4,7 @@ import { ImageZoom, type ImageZoomProps } from "fumadocs-ui/components/image-zoo
44import { Step , Steps } from "fumadocs-ui/components/steps" ;
55import { Tab , Tabs } from "fumadocs-ui/components/tabs" ;
66import { TypeTable } from "fumadocs-ui/components/type-table" ;
7+ import Image , { type ImageProps } from "next/image" ;
78import { notFound } from "next/navigation" ;
89import { HTMLAttributes } from "react" ;
910
@@ -26,23 +27,8 @@ const defaultMdxComponents = {
2627 Tab,
2728 Tabs,
2829 TypeTable,
29- img : ( props : ImageZoomProps ) => {
30- // Don't apply ImageZoom to images inside Card components
31- // This prevents the unwanted zoom behavior on partner logos and other card images
32- if (
33- props . className ?. includes ( "object-contain" ) ||
34- props . alt ?. includes ( "Network" ) ||
35- props . alt ?. includes ( "Protocol" ) ||
36- props . alt ?. includes ( "Terminal" ) ||
37- props . alt ?. includes ( "Lit" ) ||
38- props . alt ?. includes ( "Rhinestone" ) ||
39- props . alt ?. includes ( "Lilypad" )
40- ) {
41- // eslint-disable-next-line @next/next/no-img-element, jsx-a11y/alt-text
42- return < img { ...( props as any ) } /> ;
43- }
44- return < ImageZoom { ...props } /> ;
45- } ,
30+ ImageNoZoom : ( props : ImageProps ) => < Image { ...props } /> ,
31+ img : ( props : ImageZoomProps ) => < ImageZoom { ...props } /> ,
4632 Card : ( props : CardProps ) => < Card { ...props } /> ,
4733 Cards : ( props : HTMLAttributes < HTMLDivElement > ) => < Cards { ...props } /> ,
4834 Callout : ( props : CalloutProps ) => < Callout { ...props } /> ,
@@ -54,9 +40,15 @@ export default async function Page(props: { params: Promise<{ slug?: string[] }>
5440 if ( ! page ) notFound ( ) ;
5541
5642 const MDX = page . data . body ;
57- // Don't show the TOC or edit button on the root page
43+ // Don't show the TOC or edit button on the root page, or the auto-generated API reference pages
5844 const isRootPage = ! params . slug || params . slug . length === 0 ;
59- const isApiPage = params . slug ?. [ 0 ] === "reference" ;
45+ const isApiReferencePage = params . slug ?. [ 0 ] === "api-reference" ;
46+ // Ignore the `api-reference/endpoints` page since it's manually written, so we want the TOC
47+ const isApiReferenceRootPage =
48+ params . slug ?. length === 2 &&
49+ params . slug ?. [ 0 ] === "api-reference" &&
50+ params . slug ?. [ 1 ] === "endpoints" ;
51+ const isApiPage = isApiReferencePage && ! isApiReferenceRootPage ;
6052 const githubPath = `docs/${ page . file . path } ` ;
6153 const githubInfo = {
6254 repo : "docs" ,
0 commit comments