Files
newz-qwen-9b/frontend/src/pages/Home.tsx
T

53 lines
2.1 KiB
TypeScript

import { ArticleCard } from '../components/articles/ArticleCard';
interface ArticleData {
id: number;
title: string;
author?: { name: string; avatar?: string };
category?: { name: string; slug: string };
createdAt: Date | string;
}
export function Home() {
const featuredArticle = {
id: 1,
title: 'Featured Article Example',
author: { name: 'John Doe', avatar: '' },
category: { name: 'Technology', slug: 'technology' },
createdAt: new Date(),
};
const articleGridData: ArticleData[] = [
{ id: 1, title: 'Article One', author: { name: 'Jane Smith', avatar: '' }, category: { name: 'News', slug: 'news' }, createdAt: new Date() },
{ id: 2, title: 'Article Two', author: { name: 'Bob Johnson', avatar: '' }, category: { name: 'Sports', slug: 'sports' }, createdAt: new Date() },
{ id: 3, title: 'Article Three', author: { name: 'Alice Brown', avatar: '' }, category: { name: 'Technology', slug: 'technology' }, createdAt: new Date() },
{ id: 4, title: 'Article Four', author: { name: 'Charlie Wilson', avatar: '' }, category: { name: 'Politics', slug: 'politics' }, createdAt: new Date() },
{ id: 5, title: 'Article Five', author: { name: 'Diana Prince', avatar: '' }, category: { name: 'Business', slug: 'business' }, createdAt: new Date() },
{ id: 6, title: 'Article Six', author: { name: 'Ethan Hunt', avatar: '' }, category: { name: 'Entertainment', slug: 'entertainment' }, createdAt: new Date() },
];
return (
<div className="home-page">
{/* Search/Filter Bar Placeholder */}
<div className="search-filter-placeholder">Search and filter articles...</div>
{/* Hero Section with Featured Article */}
<section className="hero-section">
<ArticleCard article={featuredArticle} />
</section>
{/* Article Grid Layout using ArticleCard */}
<section className="article-grid">
{articleGridData.map(article => (
<ArticleCard key={article.id} article={article} />
))}
</section>
{/* Pagination or Infinite Scroll Placeholder */}
<div className="pagination-placeholder">Load more articles...</div>
</div>
);
}
export default Home;