import cx from 'classnames' import { useState } from 'react' import { ChevronDownIcon } from '@primer/octicons-react' import { ProductTreeNode, useMainContext } from 'components/context/MainContext' import { Link } from 'components/Link' const maxArticles = 10 export const ProductArticlesList = () => { const { currentProductTree } = useMainContext() if (!currentProductTree) { return null } return (
{currentProductTree.childPages.map((treeNode, i) => { if (treeNode.page.documentType === 'article') { return null } return })}
) } const ProductTreeNodeList = ({ treeNode }: { treeNode: ProductTreeNode }) => { const [isShowingMore, setIsShowingMore] = useState(false) return (

{treeNode.renderedFullTitle}

{!isShowingMore && treeNode.childPages.length > maxArticles && ( )}
) }