'use client';

import { GalleryImageCard } from './GalleryImageCard';

type ImageItem = {
  name: string;
  url: string;
  size: number;
  contentType: string;
  lastModified: string;
};

type ImageGridProps = {
  images: ImageItem[];
  onDownloadMeasured: (imageId: string, downloadMs: number) => void;
};

export const ImageGrid = ({ images, onDownloadMeasured }: ImageGridProps) => {
  return (
    <div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4 md:gap-6">
      {images.map((image) => (
        <GalleryImageCard
          key={image.url}
          imageUrl={image.url}
          filename={image.name}
          size={image.size}
          contentType={image.contentType}
          lastModified={image.lastModified}
          onDownloadMeasured={onDownloadMeasured}
        />
      ))}
    </div>
  );
};
