import React from 'react' import { usePage } from '@inertiajs/react' import SeoHead from '../../components/seo/SeoHead' import ChallengeWorldLinkBadge from '../../components/worlds/ChallengeWorldLinkBadge' import WorldChallengeArtworkCard from '../../components/worlds/WorldChallengeArtworkCard' function OutcomeSection({ section }) { const items = Array.isArray(section?.items) ? section.items : [] if (items.length === 0) { return null } return (

{section.label}

{items.map((item) => )}
) } export default function GroupChallengeShow() { const { props } = usePage() const group = props.group || {} const challenge = props.challenge || {} const linkedWorld = props.linkedWorld || null const outcomeSections = challenge.outcome_sections || {} return (
{challenge.cover_url ? {challenge.title} :
}
{group.name}

{challenge.title}

{challenge.summary || challenge.description || 'Group challenge'}

{challenge.status} {challenge.visibility} {String(challenge.participation_scope || '').replace('_', ' ')} {challenge.start_at ? Starts {new Date(challenge.start_at).toLocaleDateString()} : null} {challenge.end_at ? Ends {new Date(challenge.end_at).toLocaleDateString()} : null}

Challenge brief

{challenge.description || 'No extended challenge brief yet.'}

{challenge.rules_text ? (
Rules

{challenge.rules_text}

) : null} {challenge.submission_instructions ? (
Submission instructions

{challenge.submission_instructions}

) : null}

Entries

{Array.isArray(challenge.artworks) && challenge.artworks.length > 0 ? challenge.artworks.map((artwork) => ( {artwork.thumb ? {artwork.title} : null}
{artwork.title}
)) :

No entries linked yet.

}
) }