import React from 'react' import WorldChallengeMeta from './WorldChallengeMeta' import WorldChallengeStatusBadge from './WorldChallengeStatusBadge' export default function WorldChallengePanel({ section }) { if (!section) { return null } const storyMeta = Array.isArray(section.story?.meta) ? section.story.meta.filter(Boolean) : [] const metaItems = [ section.timeframe_label, Number(section.entry_count || 0) > 0 ? `${section.entry_count} entries` : null, section.has_winner ? 'Winner synced' : null, ] return (
{section.cover_url ? {section.title} : null}
{section.group?.name ? {section.group.name} : null}

{section.title}

{section.summary ?

{section.summary}

: null}
Linked challenge
{section.show_entries ?
Derived entries rail enabled
: null} {section.show_winners ?
Winner section enabled
: null} {section.show_finalists ?
{section.supports_finalists ? 'Finalists section enabled' : 'Finalists section unavailable'}
: null}
{section.story?.url ? (
{section.story.eyebrow || section.story.context_label || 'Challenge story'}
{section.story.title} {section.story.description ?

{section.story.description}

: null} {storyMeta.length > 0 ?
{storyMeta.map((item) => {item})}
: null}
) : null}
{section.cta_label || 'Open challenge'} {section.story?.url && section.story.url !== section.cta_url ? {section.story.cta_label || 'Read story'} : null} {section.challenge_url && section.challenge_url !== section.cta_url ? Open challenge : null} {section.group?.url ? Open group : null}
) }