import Link from 'next/link' import { allDocs } from '@/.velite' import { frameworkTitles } from '@/config/docs' /** * Static list of links to the other framework versions of a block. Rendered on the server so * every version of a block is reachable from the page HTML, not only from the framework menu. */ export function OtherFrameworks({ slug }: { slug: string }) { const [currentFramework, ...docPath] = slug.split('/') const docName = docPath.join('/') // Other versions are the docs with the same path under a different framework folder const otherFrameworks = Object.keys(frameworkTitles).filter( (framework) => framework !== currentFramework && allDocs.some((doc) => doc.slugAsParams === `${framework}/${docName}`) ) if (!(currentFramework in frameworkTitles) || otherFrameworks.length === 0) { return null } return ( ) }