import React from 'react' import cx from 'classnames' import { CheckIcon, SearchIcon } from '@primer/octicons-react' import { PlaygroundContentBlock } from './PlaygroundContentBlock' import { ArticleMarkdown } from 'components/playground/ArticleMarkdown' import { getAnchorLink } from 'components/lib/getAnchorLink' import { usePlaygroundContext } from 'components/context/PlaygroundContext' export const PlaygroundArticle = () => { const { article } = usePlaygroundContext() if (!article) { return null } return (
{/* article header */}

{article.title}

{article.intro}

{article.prerequisites && (

Prerequisites

{article.prerequisites}
)} {/* toc */}

In this Article

    {article.contentBlocks.map((block) => { if (!block.title || block.type === 'sub-section-2') { return null } const anchor = getAnchorLink(block.title) if (block.type === 'sub-section') { return (
  • {block.title}
  • ) } return (
  • {block.title}
  • ) })}
{/* body */} {article.contentBlocks.map((block, index) => ( ))} {/* spacer for end of article */}
) } const Circle = ({ className, children }: { className?: string; children?: React.ReactNode }) => { return (
{children}
) }