import React from 'react'
import { Head, usePage } from '@inertiajs/react'
import ArtworkGallery from '../../components/artwork/ArtworkGallery'
import CollectionCard from '../../components/profile/collections/CollectionCard'
import CollectionVisibilityBadge from '../../components/profile/collections/CollectionVisibilityBadge'
import CommentForm from '../../components/social/CommentForm'
import CommentList from '../../components/social/CommentList'
import useWebShare from '../../hooks/useWebShare'
function getCsrfToken() {
if (typeof document === 'undefined') return ''
return document.querySelector('meta[name="csrf-token"]')?.getAttribute('content') || ''
}
async function requestJson(url, { method = 'POST', body } = {}) {
const response = await fetch(url, {
method,
credentials: 'same-origin',
headers: {
Accept: 'application/json',
'Content-Type': 'application/json',
'X-CSRF-TOKEN': getCsrfToken(),
'X-Requested-With': 'XMLHttpRequest',
},
body: body ? JSON.stringify(body) : undefined,
})
const payload = await response.json().catch(() => ({}))
if (!response.ok) {
throw new Error(payload?.message || 'Request failed.')
}
return payload
}
function TypeBadge({ collection }) {
const label = collection?.type === 'editorial'
? 'Editorial'
: collection?.type === 'community'
? 'Community'
: 'Personal'
return {label}
}
function CollaboratorCard({ member }) {
return (
Submitted by @{submission?.user?.username}
{submission?.message ?{submission.message}
: null}{isOwner ? (smart ? 'Adjust the smart rules to broaden the match or publish more artworks that fit this set.' : 'Add artworks to start building the visual rhythm, cover image, and sequence for this showcase.') : (smart ? 'This smart collection does not have visible matches right now.' : 'There are no visible artworks in this collection right now.')}
{eyebrow}
{item.subtitle}
: null} {item?.relationship_type ?{item.relationship_type}
: null}{item.description}
: null} ) } function humanizeToken(value) { return String(value || '') .replaceAll('_', ' ') .replaceAll('-', ' ') .replace(/\b\w/g, (match) => match.toUpperCase()) } function groupEntityLinks(items) { return (Array.isArray(items) ? items : []).reduce((groups, item) => { const key = item?.linked_type || 'other' if (!groups[key]) groups[key] = [] groups[key].push(item) return groups }, {}) } function recommendationReasons(currentCollection, candidate) { const reasons = [] if (candidate?.event_key && currentCollection?.event_key && candidate.event_key === currentCollection.event_key) { reasons.push('Same event context') } if (candidate?.campaign_key && currentCollection?.campaign_key && candidate.campaign_key === currentCollection.campaign_key) { reasons.push('Same campaign') } if (candidate?.theme_token && currentCollection?.theme_token && candidate.theme_token === currentCollection.theme_token) { reasons.push('Shared theme') } if (candidate?.type && currentCollection?.type && candidate.type === currentCollection.type) { reasons.push(`${humanizeToken(candidate.type)} collection`) } if (candidate?.owner?.id && currentCollection?.owner?.id && candidate.owner.id === currentCollection.owner.id) { reasons.push('Same curator') } if (candidate?.trust_tier && currentCollection?.trust_tier && candidate.trust_tier === currentCollection.trust_tier) { reasons.push(`${humanizeToken(candidate.trust_tier)} trust tier`) } return reasons.slice(0, 3) } function ContextSignalCard({ item }) { const wrapperClassName = 'flex h-full flex-col gap-3 rounded-[24px] border border-white/10 bg-white/[0.04] p-5 transition hover:bg-white/[0.07]' const body = ( <>{item.subtitle}
: null}{item.description}
: null} > ) if (item.url) { return {body} } returnStart with the standout pieces from this collection before diving into the full sequence.
This collection is curated by a single owner right now.
}Sign in with at least one artwork on your account to submit here.
)}No submissions yet.
}{collection.subtitle}
: null} {collection?.description ?{collection.description}
:A curated selection from @{owner?.username}, assembled as a focused gallery rather than a simple archive.
} {collection?.smart_summary ?{collection.smart_summary}
: null} {featuringCreatorsCount > 1 ?Featuring artworks by {featuringCreatorsCount} creators.
: null} > ) : null}{state.notice}
: null}Series
{seriesContext.description}
: null}Related Context
Stories
Browse The Theme
Connected Creators