import type { ReactNode } from 'react' import { defineI18nUI } from 'fumadocs-ui/i18n' import { DocsLayout } from 'fumadocs-ui/layouts/docs' import { RootProvider } from 'fumadocs-ui/provider/next' import { Geist_Mono, Inter } from 'next/font/google' import { AskAI } from '@/components/ai/ask-ai' import { SidebarFolder, SidebarItem, SidebarSeparator, } from '@/components/docs-layout/sidebar-components' import { Footer } from '@/components/footer/footer' import { Navbar } from '@/components/navbar/navbar' import { SimWordmark } from '@/components/ui/sim-logo' import { i18n } from '@/lib/i18n' import { serializeJsonLd } from '@/lib/json-ld' import { source } from '@/lib/source' import { DOCS_BASE_URL } from '@/lib/urls' import { season } from '@/app/fonts/season' import '../global.css' const inter = Inter({ subsets: ['latin'], variable: '--font-geist-sans', display: 'swap', }) const geistMono = Geist_Mono({ subsets: ['latin'], variable: '--font-geist-mono', display: 'swap', }) const { provider } = defineI18nUI(i18n, { translations: { en: { displayName: 'English', }, es: { displayName: 'Español', }, fr: { displayName: 'Français', }, de: { displayName: 'Deutsch', }, ja: { displayName: '日本語', }, zh: { displayName: '简体中文', }, }, }) type LayoutProps = { children: ReactNode params: Promise<{ lang: string }> } const SUPPORTED_LANGUAGES: Set = new Set(i18n.languages) export default async function Layout({ children, params }: LayoutProps) { const { lang: rawLang } = await params const lang = SUPPORTED_LANGUAGES.has(rawLang) ? rawLang : 'en' const structuredData = { '@context': 'https://schema.org', '@type': 'WebSite', name: 'Sim Documentation', description: 'Documentation for Sim — the open-source AI workspace where teams build, deploy, and manage AI agents. Connect 1,000+ integrations and every major LLM.', url: DOCS_BASE_URL, publisher: { '@type': 'Organization', name: 'Sim', url: 'https://sim.ai', logo: { '@type': 'ImageObject', url: `${DOCS_BASE_URL}/static/logo.png`, }, }, inLanguage: lang, } return (