import Link from "next/link"; import Image from "next/image"; import { ArrowRight, Calendar } from "lucide-react"; import { SectionHeading } from "../common/SectionHeading"; import { getLatestPosts } from "@/content/posts"; export function BlogPreview() { const latestPosts = getLatestPosts(3); const formatDate = (dateStr: string) => { const d = new Date(dateStr); return d.toLocaleDateString("pl-PL", { year: "numeric", month: "long", day: "numeric", }); }; const getCategoryLabel = (cat: string) => { const labels: Record = { klimatyzacja: "Klimatyzacja", porady: "Porady ogólne", }; return labels[cat] || cat; }; return (
{latestPosts.map((post) => (
{post.title}
{getCategoryLabel(post.category)} {formatDate(post.date)}

{post.title}

{post.excerpt}

Czytaj więcej
))}
Przejdź do bloga
); }