feat: ArticleGrid and Homepage

This commit is contained in:
achmad
2026-05-28 22:30:17 +07:00
parent 1de59aba84
commit cffc2808b5
2 changed files with 56 additions and 98 deletions
+29
View File
@@ -0,0 +1,29 @@
import ArticleCard from '@/components/article/ArticleCard'
import type { Article } from '@/lib/types'
interface Props {
articles: Article[]
title?: string
}
export default function ArticleGrid({ articles, title }: Props) {
if (articles.length === 0) return null
return (
<section className="max-w-[1200px] mx-auto px-6 py-6">
{title && (
<div className="flex items-center gap-4 mb-5">
<h2 className="text-xs font-bold text-text-primary uppercase tracking-widest shrink-0">
{title}
</h2>
<div className="flex-1 h-px bg-border" />
</div>
)}
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4">
{articles.map((article) => (
<ArticleCard key={article.id} article={article} />
))}
</div>
</section>
)
}