()
| 30 | const isDev = process.env.NODE_ENV === 'development' |
| 31 | |
| 32 | export const ArticlePage = () => { |
| 33 | const router = useRouter() |
| 34 | const { |
| 35 | title, |
| 36 | intro, |
| 37 | effectiveDate, |
| 38 | renderedPage, |
| 39 | permissions, |
| 40 | includesPlatformSpecificContent, |
| 41 | includesToolSpecificContent, |
| 42 | product, |
| 43 | productVideoUrl, |
| 44 | miniTocItems, |
| 45 | currentLearningTrack, |
| 46 | } = useArticleContext() |
| 47 | const isLearningPath = !!currentLearningTrack?.trackName |
| 48 | const { t } = useTranslation(['pages']) |
| 49 | |
| 50 | return ( |
| 51 | <DefaultLayout> |
| 52 | {isDev && <ClientSideRefresh />} |
| 53 | <ClientSideHighlight /> |
| 54 | {router.pathname.includes('/rest/') && <RestRedirect />} |
| 55 | <div className="container-xl px-3 px-md-6 my-4"> |
| 56 | <div className={cx('d-none d-xl-block mt-3 mr-auto width-full')}> |
| 57 | <Breadcrumbs /> |
| 58 | </div> |
| 59 | <ArticleGridLayout |
| 60 | topper={<ArticleTitle>{title}</ArticleTitle>} |
| 61 | intro={ |
| 62 | <> |
| 63 | {intro && ( |
| 64 | <Lead data-testid="lead" data-search="lead"> |
| 65 | {intro} |
| 66 | </Lead> |
| 67 | )} |
| 68 | |
| 69 | {permissions && <PermissionsStatement permissions={permissions} />} |
| 70 | |
| 71 | {includesPlatformSpecificContent && <PlatformPicker />} |
| 72 | {includesToolSpecificContent && <ToolPicker />} |
| 73 | |
| 74 | {product && ( |
| 75 | <Callout |
| 76 | variant="success" |
| 77 | className="mb-4" |
| 78 | dangerouslySetInnerHTML={{ __html: product }} |
| 79 | /> |
| 80 | )} |
| 81 | </> |
| 82 | } |
| 83 | toc={ |
| 84 | <> |
| 85 | {isLearningPath && <LearningTrackCard track={currentLearningTrack} />} |
| 86 | {miniTocItems.length > 1 && <MiniTocs miniTocItems={miniTocItems} />} |
| 87 | </> |
| 88 | } |
| 89 | > |
nothing calls this directly
no test coverage detected