import { useRouter } from 'next/router' import dynamic from 'next/dynamic' import cx from 'classnames' import { Box, Flash } from '@primer/react' import { LinkExternalIcon, BeakerIcon } from '@primer/octicons-react' import { Callout } from 'components/ui/Callout' import { DefaultLayout } from 'components/DefaultLayout' import { ArticleTitle } from 'components/article/ArticleTitle' import { useArticleContext } from 'components/context/ArticleContext' import { LearningTrackNav } from './LearningTrackNav' import { MarkdownContent } from 'components/ui/MarkdownContent' import { Lead } from 'components/ui/Lead' import { PermissionsStatement } from 'components/ui/PermissionsStatement' import { ArticleGridLayout } from './ArticleGridLayout' import { PlatformPicker } from 'components/article/PlatformPicker' import { ToolPicker } from 'components/article/ToolPicker' import { MiniTocs } from 'components/ui/MiniTocs' import { ClientSideHighlight } from 'components/ClientSideHighlight' import { LearningTrackCard } from 'components/article/LearningTrackCard' import { RestRedirect } from 'components/RestRedirect' import { Breadcrumbs } from 'components/page-header/Breadcrumbs' import { Link } from 'components/Link' import { useTranslation } from 'components/hooks/useTranslation' import { LinkPreviewPopover } from 'components/LinkPreviewPopover' import { SupportPortalVaIframe } from 'components/article/SupportPortalVaIframe' const ClientSideRefresh = dynamic(() => import('components/ClientSideRefresh'), { ssr: false, }) const isDev = process.env.NODE_ENV === 'development' export const ArticlePage = () => { const router = useRouter() const { title, intro, effectiveDate, renderedPage, permissions, includesPlatformSpecificContent, includesToolSpecificContent, product, productVideoUrl, miniTocItems, currentLearningTrack, supportPortalVaIframeProps, } = useArticleContext() const isLearningPath = !!currentLearningTrack?.trackName const { t } = useTranslation(['pages']) return ( {supportPortalVaIframeProps.supportPortalUrl && supportPortalVaIframeProps.vaFlowUrlParameter && ( )} {isDev && } {router.pathname.includes('/rest/') && }
{/* This is a temporary thing for the duration of the feature-flagged release of hover preview cards on /$local/pages/ articles. Delete this whole thing when hover preview cards is available on all articles independent of path. */} {router.query.productId === 'pages' && (

Hover over a link to another article to get more details. If you have ideas for how we can improve this page, let us know in the{' '} discussion.

)} {title} } intro={ <> {intro && ( // Note the `_page-intro` is used by the popover preview cards // when it needs this text for in-page links. {intro} )} {permissions && } {includesPlatformSpecificContent && } {includesToolSpecificContent && } {product && ( )} } toc={ <> {isLearningPath && } {miniTocItems.length > 1 && } } >
{productVideoUrl && (
{t('video_from_transcript')}
)} {renderedPage} {effectiveDate && (
Effective as of:{' '}
)}
{isLearningPath ? (
) : null}
) }