"use client" import { Button } from "@/components/ui/button" import { Card, CardContent } from "@/components/ui/card" import { Badge } from "@/components/ui/badge" import { CalendarIcon, ArrowRightIcon } from "lucide-react" import Image from "next/image" import Link from "next/link" import { useTranslations } from "next-intl" interface BlogSectionProps { locale: string } export default function BlogSection({ locale }: BlogSectionProps) { const t = useTranslations("blog") // 博客文章配置,按时间顺序排列(最新的在前) const blogPostsConfig = [ { key: "contact", link: `/${locale}/blog/contact-us`, sortDate: "2025-06-01", image: "/images/Get in Touch with Aiartools Team.png" }, { key: "editingGuide", link: `/${locale}/blog/how-to-edit-images`, sortDate: "2025-06-01", image: "/images/How to Edit Images with Aiartools.png" }, { key: "introduction", link: `/${locale}/blog/introducing-aiartools`, sortDate: "2025-05-31", image: "/images/Transform Your Images with the Power of AI.png" }, ] // 按时间排序(最新的在前) const sortedPosts = blogPostsConfig.sort((a, b) => new Date(b.sortDate).getTime() - new Date(a.sortDate).getTime() ) return (

{t("title")}

{t("subtitle")}

{sortedPosts.map((postConfig, index) => (
{t(`posts.${postConfig.key}.title`)}
{t(`posts.${postConfig.key}.category`)}
{t(`posts.${postConfig.key}.date`)} {t(`posts.${postConfig.key}.readTime`)}

{t(`posts.${postConfig.key}.title`)}

{t(`posts.${postConfig.key}.excerpt`)}

))}
) }