import React from 'react'
import ArtworkGallery from './ArtworkGallery'

function cx(...parts) {
  return parts.filter(Boolean).join(' ')
}

export default function ArtworkGalleryGrid({
  items,
  compact = false,
  showStats = true,
  showAuthor = true,
  limit,
  className = '',
  cardClassName = '',
}) {
  if (!Array.isArray(items) || items.length === 0) return null

  const visibleItems = typeof limit === 'number' ? items.slice(0, limit) : items

  return (
    <ArtworkGallery
      items={visibleItems}
      layout="grid"
      compact={compact}
      showStats={showStats}
      showAuthor={showAuthor}
      className={cx(className)}
      cardClassName={cardClassName}
    />
  )
}
