import Link from 'next/link'
import { ChevronUpIcon } from '@primer/octicons-react'
import cx from 'classnames'
import { useProductLandingContext, Product } from 'components/context/ProductLandingContext'
import { useState } from 'react'
const maxArticles = 10
export const AllArticlesProduct = () => {
const { product } = useProductLandingContext()
return (
{Object.entries(product.categories).map(([key, category]) => {
if (category.standalone) {
return null
}
return
})}
)
}
const ArticleList = ({ category }: { category: Product['categories'][0] }) => {
const [isShowingMore, setIsShowingMore] = useState(false)
const numArticles = Object.keys(category.articles || {}).length
return (
{Object.entries(category.articles || {}).map(([key, article], i) => {
return (
- maxArticles - 1 && 'd-none')}>
{article.title}
)
})}
{numArticles > maxArticles && !isShowingMore && (
)}
)
}