INNER CODE UNIT · JavaScript
getVersionMainDoc
graphiti-api/graphiti · website/src/theme/DocVersionBanner/index.js:18
const getVersionMainDoc = (version) =>
version.docs.find((doc) => doc.id === version.mainDocId);
const {savePreferredVersionName} = useDocsPreferredVersion(pluginId);
const {latestDocSuggestion, latestVersionSuggestion} =
useDocVersionSuggestions(pluginId);
const latestVersionSuggestedDoc =
latestDocSuggestion ?? getVersionMainDoc(latestVersionSuggestion);
return (
<div
className={clsx(
className,
ThemeClassNames.docs.docVersionBanner,
'alert alert--warning margin-bottom--md',
)}
role="alert">
This is the documentation for {siteTitle} <b>{versionMetadata.label}</b>.
The latest version is{' '}
<b>