diff --git a/client/src/pages/home.tsx b/client/src/pages/home.tsx index e378afc..d8decd9 100644 --- a/client/src/pages/home.tsx +++ b/client/src/pages/home.tsx @@ -3,63 +3,85 @@ import { Link } from "wouter"; import { type Article } from "@shared/schema"; import { format } from "date-fns"; import { de } from "date-fns/locale"; -import { Eye, MessageSquare, ChevronRight, ChevronLeft, Clock } from "lucide-react"; +import { Eye, Clock } from "lucide-react"; import { Badge } from "@/components/ui/badge"; import { Skeleton } from "@/components/ui/skeleton"; import { Button } from "@/components/ui/button"; -import { useState, useEffect } from "react"; import Header from "@/components/header"; import Footer from "@/components/footer"; -function FeaturedCarousel({ articles }: { articles: Article[] }) { - const [current, setCurrent] = useState(0); - - useEffect(() => { - if (articles.length === 0) return; - const timer = setInterval(() => { - setCurrent((prev) => (prev + 1) % articles.length); - }, 5000); - return () => clearInterval(timer); - }, [articles.length]); - +function FeaturedSection({ articles }: { articles: Article[] }) { if (articles.length === 0) return null; + const hero = articles[0]; + const side = articles.slice(1, 3); + return ( -
-

Neueste Artikel

-
- {articles.map((article, i) => ( - -
-
- {article.title} -
- - {article.category} - -
- - {format(new Date(article.publishedAt), "d. MMMM yyyy", { locale: de })} - -

- {article.title} -

-
+
+

Neueste Artikel

+
+ +
+
+ {hero.title} +
+ + {hero.category} + +
+ + {format(new Date(hero.publishedAt), "d. MMMM yyyy", { locale: de })} + +

+ {hero.title} +

+

+ {hero.excerpt} +

- - ))} +
+ + +
+ {side.map((article) => ( + +
+
+ {article.title} +
+ + {article.category} + +
+ + {format(new Date(article.publishedAt), "d. MMMM yyyy", { locale: de })} + +

+ {article.title} +

+
+
+
+ + ))} +
); @@ -69,33 +91,33 @@ function ArticleCard({ article }: { article: Article }) { return (
{article.title} {article.category}
-
-
+
+
{article.author} ยท {format(new Date(article.publishedAt), "d. MMMM yyyy", { locale: de })}
-

+

{article.title}

-

+

{article.excerpt}

-
+
@@ -114,25 +136,25 @@ function ArticleCard({ article }: { article: Article }) { function PopularSidebar({ articles }: { articles: Article[] }) { return ( -