({
categories,
blogData,
})
| 19 | })); |
| 20 | |
| 21 | const WithBlogCategories: FC<WithBlogCategoriesProps> = ({ |
| 22 | categories, |
| 23 | blogData, |
| 24 | }) => { |
| 25 | const t = useTranslations(); |
| 26 | |
| 27 | return ( |
| 28 | <> |
| 29 | <LinkTabs |
| 30 | label={t('layouts.blog.selectCategory')} |
| 31 | tabs={categories} |
| 32 | activeTab={blogData.category} |
| 33 | > |
| 34 | <div className="max-ml:grid-cols-[1fr] grid grid-cols-[repeat(auto-fill,minmax(--spacing(80),1fr))] [grid-gap:--spacing(12)_--spacing(8)]"> |
| 35 | {blogData.posts.map(post => ( |
| 36 | <BlogPostCard |
| 37 | key={post.slug} |
| 38 | title={post.title} |
| 39 | category={post.categories[0]} |
| 40 | authors={mapAuthorToCardAuthors(post.author)} |
| 41 | date={post.date} |
| 42 | slug={post.slug} |
| 43 | /> |
| 44 | ))} |
| 45 | </div> |
| 46 | </LinkTabs> |
| 47 | |
| 48 | <div className="mt-4 border-t border-t-neutral-200 pt-5 md:mt-8 dark:border-t-neutral-900"> |
| 49 | <Pagination |
| 50 | currentPage={blogData.page} |
| 51 | pages={mapPaginationPages( |
| 52 | blogData.category, |
| 53 | blogData.pagination.pages |
| 54 | )} |
| 55 | /> |
| 56 | </div> |
| 57 | </> |
| 58 | ); |
| 59 | }; |
| 60 | |
| 61 | export default WithBlogCategories; |
nothing calls this directly
no test coverage detected