"use client" import { useState } from "react" import { BLOG_POSTS, BLOG_CATEGORIES } from "@/lib/blog-data" import BlogCard from "@/components/BlogCard" export default function PostsGridSection() { const [activeCategory, setActiveCategory] = useState<(typeof BLOG_CATEGORIES)[number]>(BLOG_CATEGORIES[0]) const filtered = activeCategory === BLOG_CATEGORIES[0] ? BLOG_POSTS : BLOG_POSTS.filter((p) => p.category === activeCategory) return (

全部文章

{BLOG_CATEGORIES.map((cat) => ( ))}
{filtered.length > 0 ? (
{filtered.map((post) => ( ))}
) : (

这个分类下的内容还在整理中,先看看其他文章。

)}
) }