"use client";

import type { WishlistItem } from "@/lib/wishlist/types";
import { WishlistItemCard } from "./WishlistItemCard";

type WishlistItemGridProps = {
  items: WishlistItem[];
  onRemove: (id: string) => void;
  onAddToCart: (variantId: string) => void;
  removingId: string | null;
  addingToCartId: string | null;
};

export function WishlistItemGrid({
  items,
  onRemove,
  onAddToCart,
  removingId,
  addingToCartId,
}: WishlistItemGridProps) {
  return (
    <div className="grid grid-cols-2 gap-4 sm:grid-cols-2 md:grid-cols-3 md:gap-6 lg:grid-cols-4">
      {items.map((item) => (
        <WishlistItemCard
          key={item._id}
          item={item}
          onRemove={onRemove}
          onAddToCart={onAddToCart}
          isRemoving={removingId === item._id}
          isAddingToCart={addingToCartId === item._id}
        />
      ))}
    </div>
  );
}
