import type { PlazaPost } from '@/types/plaza';
import { PostCard } from '@/components/feed/PostCard';

export function PostGrid({ posts }: { posts: PlazaPost[] }) {
  if (posts.length === 0) {
    return (
      <div className="rounded-2xl border border-dashed border-[#d6d0c3] bg-[#fffdf7] px-6 py-16 text-center">
        <p className="text-lg font-semibold text-[#17221d]">暂无内容</p>
        <p className="mt-2 text-sm text-[#68716c]">发布到广场的作品会出现在这里</p>
      </div>
    );
  }

  return (
    <div className="grid grid-cols-2 gap-4 md:grid-cols-3 lg:grid-cols-4">
      {posts.map((post, index) => (
        <PostCard key={post.id} post={post} priority={index < 4} />
      ))}
    </div>
  );
}
