import React from 'react' import { motion, useReducedMotion } from 'framer-motion' function stripHtml(value) { return String(value || '') .replace(/<[^>]*>/g, ' ') .replace(/ /g, ' ') .replace(/\s+/g, ' ') .trim() } /** * PublishCheckBadge – a single status item for the review section */ function PublishCheckBadge({ label, ok }) { return ( {label} ) } /** * Step3Publish * * Step 3 of the upload wizard: review summary and publish action. * Shows a compact artwork preview, metadata summary, readiness badges, * and a summary of publish mode / schedule + visibility. * * Publish controls (mode/schedule picker) live in PublishPanel (sidebar). * This step serves as the final review before the user clicks Publish. */ export default function Step3Publish({ headingRef, // Asset primaryFile, primaryPreviewUrl, isArchive, screenshots, fileMetadata, // Metadata metadata, // Readiness canPublish, uploadReady, // Publish options (from wizard state, for summary display only) publishMode = 'now', scheduledAt = null, timezone = null, visibility = 'public', // Category tree (for label lookup) allRootCategoryOptions = [], filteredCategoryTree = [], }) { const prefersReducedMotion = useReducedMotion() const quickTransition = prefersReducedMotion ? { duration: 0 } : { duration: 0.2, ease: 'easeOut' } const hasPreview = Boolean(primaryPreviewUrl && !isArchive) // ── Category label lookup ──────────────────────────────────────────────── const rootCategory = allRootCategoryOptions.find( (r) => String(r.id) === String(metadata.rootCategoryId) ) ?? null const rootLabel = rootCategory?.name ?? null const subCategory = rootCategory?.children?.find( (c) => String(c.id) === String(metadata.subCategoryId) ) ?? null const subLabel = subCategory?.name ?? null const descriptionPreview = stripHtml(metadata.description) const checks = [ { label: 'File uploaded', ok: uploadReady }, { label: 'Scan passed', ok: uploadReady }, { label: 'Preview ready', ok: hasPreview || (isArchive && screenshots.length > 0) }, { label: 'Rights confirmed', ok: Boolean(metadata.rightsAccepted) }, { label: 'Tags added', ok: Array.isArray(metadata.tags) && metadata.tags.length > 0 }, ] return (
Everything looks good? Hit Publish to make your artwork live.
{metadata.title || Untitled artwork}
{descriptionPreview}
)}Readiness checks