@@ -14,10 +14,11 @@ import { StructuredData } from '@/components/structured-data'
1414import { CodeBlock } from '@/components/ui/code-block'
1515import { Heading } from '@/components/ui/heading'
1616import { ResponseSection } from '@/components/ui/response-section'
17+ import { i18n } from '@/lib/i18n'
1718import { getApiSpecContent , openapi } from '@/lib/openapi'
1819import { type PageData , source } from '@/lib/source'
1920
20- const SUPPORTED_LANGUAGES = new Set ( [ 'en' , 'es' , 'fr' , 'de' , 'ja' , 'zh' ] )
21+ const SUPPORTED_LANGUAGES = new Set ( i18n . languages )
2122
2223const APIPage = createAPIPage ( openapi , {
2324 playground : { enabled : false } ,
@@ -53,15 +54,14 @@ export default async function Page(props: { params: Promise<{ slug?: string[]; l
5354
5455 const data = page . data as PageData & {
5556 _openapi ?: { method ?: string }
56- getAPIPageProps ?: ( ) => any
57+ getAPIPageProps ?: ( ) => unknown
5758 }
5859 const isOpenAPI = '_openapi' in data && data . _openapi != null
5960 const isApiReference = slug ?. some ( ( s ) => s === 'api-reference' ) ?? false
6061 const baseUrl = 'https://docs.sim.ai'
6162
62- const pageTreeRecord = source . pageTree as Record < string , any >
63- const pageTree =
64- pageTreeRecord [ params . lang ] ?? pageTreeRecord . en ?? Object . values ( pageTreeRecord ) [ 0 ]
63+ const pageTreeRecord = source . pageTree as Record < string , unknown >
64+ const pageTree = pageTreeRecord [ lang ] ?? pageTreeRecord . en ?? Object . values ( pageTreeRecord ) [ 0 ]
6565 const rawNeighbours = pageTree ? findNeighbour ( pageTree , page . url ) : null
6666 const neighbours = isApiReference
6767 ? {
@@ -226,7 +226,7 @@ export default async function Page(props: { params: Promise<{ slug?: string[]; l
226226 title = { data . title }
227227 description = { data . description || '' }
228228 url = { `${ baseUrl } ${ page . url } ` }
229- lang = { params . lang }
229+ lang = { lang }
230230 breadcrumb = { breadcrumbs }
231231 />
232232 < DocsPage
@@ -274,7 +274,7 @@ export default async function Page(props: { params: Promise<{ slug?: string[]; l
274274 title = { data . title }
275275 description = { data . description || '' }
276276 url = { `${ baseUrl } ${ page . url } ` }
277- lang = { params . lang }
277+ lang = { lang }
278278 breadcrumb = { breadcrumbs }
279279 />
280280 < DocsPage
0 commit comments