import Link from 'next/link'
import { useState } from 'react'
import { ChevronUpIcon } from '@primer/octicons-react'
import { SiteTreePage, useMainContext } from 'components/context/MainContext'
const maxArticles = 10
export const ProductArticlesList = () => {
const { productSiteTreeNew } = useMainContext()
if (!productSiteTreeNew) {
return null
}
return (
{productSiteTreeNew.childPages.map((childPage) => {
if (childPage.page.documentType === 'article') {
return null
}
return
})}
)
}
const ArticleList = ({ page }: { page: SiteTreePage }) => {
const [isShowingMore, setIsShowingMore] = useState(false)
return (
{page.childPages.map((grandchildPage) => {
if (page.childPages[0].page.documentType === 'mapTopic' && grandchildPage.page.hidden) {
return null
}
return (
-
{grandchildPage.page.title}
)
})}
{!isShowingMore && page.childPages.length > maxArticles && (
)}
)
}