11import type React from 'react'
22import { Children , cloneElement , isValidElement } from 'react'
3- import { LANDING_SLUG_BY_DOCS_SLUG } from '@sim/deployment-config/integration-docs'
4- import { INTEGRATION_METADATA } from '@sim/deployment-config/integration-metadata'
53import { highlight } from 'fumadocs-core/highlight'
64import { findNeighbour } from 'fumadocs-core/page-tree'
75import type { ApiPageProps } from 'fumadocs-openapi/ui'
@@ -19,28 +17,14 @@ import { APIExampleSelector } from '@/components/ui/api-example-selector'
1917import { CodeBlock } from '@/components/ui/code-block'
2018import { Heading } from '@/components/ui/heading'
2119import { ResponseSection } from '@/components/ui/response-section'
20+ import { getIntegrationLandingPage , INTEGRATION_LANDING_LABEL } from '@/lib/integration-landing'
2221import { getApiSpecContent , getAuthenticatedCodeSamples , openapi } from '@/lib/openapi'
2322import { simShikiOptions } from '@/lib/shiki-theme'
2423import { type PageData , source } from '@/lib/source'
25- import { DOCS_BASE_URL , SIM_SITE_URL } from '@/lib/urls'
24+ import { DOCS_BASE_URL } from '@/lib/urls'
2625
2726const BASE_URL = DOCS_BASE_URL
2827
29- const INTEGRATION_NAME_BY_LANDING_SLUG = new Map (
30- INTEGRATION_METADATA . map ( ( integration ) => [ integration . slug , integration . name ] )
31- )
32-
33- /** The landing page a docs integration page (`/integrations/<docs slug>`) links to, if any. */
34- function getIntegrationLandingPage ( slug : string [ ] | undefined ) {
35- if ( slug ?. length !== 2 || slug [ 0 ] !== 'integrations' ) return undefined
36- const landingSlug = LANDING_SLUG_BY_DOCS_SLUG . get ( slug [ 1 ] )
37- if ( ! landingSlug ) return undefined
38- return {
39- name : INTEGRATION_NAME_BY_LANDING_SLUG . get ( landingSlug ) ?? landingSlug ,
40- url : `${ SIM_SITE_URL } /integrations/${ landingSlug } ` ,
41- }
42- }
43-
4428/**
4529 * Most pages close with a `## Next` / `## Next steps` grid of onward links.
4630 * That heading is navigation, not content, so it is kept out of the table of
@@ -286,10 +270,8 @@ export default async function Page(props: { params: Promise<{ slug?: string[] }>
286270 < DocsBody >
287271 { integrationLandingPage && (
288272 < p >
289- Use cases and templates:{ ' ' }
290- < a href = { integrationLandingPage . url } >
291- { integrationLandingPage . name } integration for AI agents
292- </ a >
273+ { INTEGRATION_LANDING_LABEL } { ' ' }
274+ < a href = { integrationLandingPage . url } > { integrationLandingPage . title } </ a >
293275 </ p >
294276 ) }
295277 < MDX
0 commit comments