import React from 'react' function statusTone(item) { if (item?.is_featured) { return 'border-amber-300/30 bg-amber-400/10 text-amber-100' } switch (item?.status) { case 'live': return 'border-emerald-300/30 bg-emerald-400/10 text-emerald-100' case 'removed': return 'border-orange-300/30 bg-orange-400/10 text-orange-100' case 'blocked': return 'border-rose-300/30 bg-rose-400/10 text-rose-100' case 'pending': return 'border-sky-300/30 bg-sky-400/10 text-sky-100' default: return 'border-white/10 bg-white/[0.04] text-slate-300' } } function modeTone(mode) { switch (mode) { case 'manual_approval': return 'border-sky-300/30 bg-sky-400/10 text-sky-100' case 'auto_add': return 'border-emerald-300/30 bg-emerald-400/10 text-emerald-100' default: return 'border-white/10 bg-white/[0.04] text-slate-300' } } function dateBadgeLabel(item) { const timeframe = String(item?.timeframe_label || '').trim() const submissionWindow = String(item?.submission_window_label || '').trim() if (timeframe && submissionWindow) { return timeframe === submissionWindow ? timeframe : `${submissionWindow} • ${timeframe}` } return submissionWindow || timeframe || '' } export default function WorldSubmissionSelector({ title = 'Add to Worlds', description = 'Attach this artwork to active worlds while keeping community participation separate from curated editorial relations.', options = [], emptyMessage = 'No worlds are currently open for creator participation.', onToggle, onNoteChange, className = '', }) { const items = Array.isArray(options) ? options : [] return (

{title}

{description}

{items.filter((item) => item.selected).length} selected
{items.length === 0 ? (
{emptyMessage}
) : (
{items.map((item) => { const checked = Boolean(item.selected) const locked = Boolean(item.selection_locked) const combinedDateLabel = dateBadgeLabel(item) return (
{item.submission_guidelines ? (
World guidelines
{item.submission_guidelines}
) : null} {item.selection_locked_reason ? (
{item.selection_locked_reason}
) : null} {item.reviewer_note ? (
Moderator note
{item.reviewer_note}
) : null} {checked && item.submission_note_enabled ? (