refactor: unify artwork card rendering
This commit is contained in:
32
resources/js/components/artwork/ArtworkGalleryGrid.jsx
Normal file
32
resources/js/components/artwork/ArtworkGalleryGrid.jsx
Normal file
@@ -0,0 +1,32 @@
|
||||
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}
|
||||
/>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user