Limit the number of displayed articles in the top stories widget

Modify the `TopStoriesList` component in `home.tsx` to display only the latest 4 articles, reducing the widget's height.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 517dfa7b-26ac-463d-a6e1-a58c6df97188
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Event-Id: df59c966-9f11-495e-afd7-7f289b663009
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/f209e72a-0939-48fa-84fc-57854de71967/517dfa7b-26ac-463d-a6e1-a58c6df97188/nFw7xof
Replit-Helium-Checkpoint-Created: true
This commit is contained in:
sebastjanartic 2026-03-02 18:04:12 +00:00
parent dcc7e6488b
commit 4282e1c591

View File

@ -570,7 +570,7 @@ export default function Home() {
</div>
<div className="lg:col-span-1 space-y-4">
<SidebarWeatherWidget />
{articles && articles.length > 0 && <TopStoriesList articles={[...articles].sort((a, b) => new Date(b.publishedAt).getTime() - new Date(a.publishedAt).getTime()).slice(0, 5)} />}
{articles && articles.length > 0 && <TopStoriesList articles={[...articles].sort((a, b) => new Date(b.publishedAt).getTime() - new Date(a.publishedAt).getTime()).slice(0, 4)} />}
<SidebarAd />
</div>
</div>