'use client'; import { usePathname, useRouter } from 'next/navigation'; import type { ReactNode } from 'react'; import { AngularIcon, JsMark, ReactIcon, SvelteIcon, VueIcon } from '@/components/site/icons'; import { DOCS_INTEGRATION_LABELS, docsIntegrationFromPath, docsIntegrationHref, INTEGRATION_COOKIE, PRODUCT_INTEGRATIONS, type DocsIntegration, } from '@/lib/docs-integrations'; import { docsProductFromPath } from '@/lib/docs-products'; /** Each integration's mark, as the switchers show it. */ export const INTEGRATION_ICONS: Record = { vanilla: , react: , vue: , svelte: , angular: , }; /** One shared sibling-route switcher for Viewer and Headless documentation. */ export function IntegrationSwitcher() { const pathname = usePathname(); const router = useRouter(); const product = docsProductFromPath(pathname); const active = docsIntegrationFromPath(pathname); if ((product !== 'viewer' && product !== 'headless') || !active) return null; const integrations = PRODUCT_INTEGRATIONS[product]; return (
Integration
{integrations.map((integration) => ( ))}
); }