import React, { useState } from 'react' import { router, usePage } from '@inertiajs/react' import SeoHead from '../../components/seo/SeoHead' import useWebShare from '../../hooks/useWebShare' function normalizeText(value) { return String(value || '').trim().toLowerCase() } function formatCompactNumber(value) { return Number(value ?? 0).toLocaleString() } function formatDateLabel(value) { if (!value) return null const date = new Date(value) if (Number.isNaN(date.getTime())) return null return date.toLocaleDateString('en-US', { month: 'long', year: 'numeric' }) } function websiteLabel(url) { if (!url) return null try { const parsed = new URL(url.startsWith('http') ? url : `https://${url}`) return parsed.hostname } catch { return String(url).replace(/^https?:\/\//, '') } } const SECTION_TABS = [ { id: 'overview', label: 'Overview', icon: 'fa-compass' }, { id: 'artworks', label: 'Artworks', icon: 'fa-images' }, { id: 'collections', label: 'Collections', icon: 'fa-layer-group' }, { id: 'posts', label: 'Posts', icon: 'fa-newspaper' }, { id: 'projects', label: 'Projects', icon: 'fa-diagram-project' }, { id: 'releases', label: 'Releases', icon: 'fa-rocket' }, { id: 'challenges', label: 'Challenges', icon: 'fa-trophy' }, { id: 'events', label: 'Events', icon: 'fa-calendar-days' }, { id: 'activity', label: 'Activity', icon: 'fa-bolt' }, { id: 'members', label: 'Members', icon: 'fa-users' }, { id: 'about', label: 'About', icon: 'fa-id-card' }, ] function sectionHref(baseUrl, tab) { return tab === 'overview' ? baseUrl : `${baseUrl}/${tab}` } function GroupTabs({ baseUrl, activeSection }) { return (
) } function GroupHero({ group, recruitment, trustSignals, following, followersCount, currentJoinRequest, shareLabel, onToggleFollow, onJoinRequest, onWithdrawJoinRequest, onShare, onReport, reportEndpoint, }) { const activeSignals = Array.isArray(trustSignals) ? trustSignals.slice(0, 3) : [] const joinDate = formatDateLabel(group.founded_at || group.created_at) const heroStats = [ { label: 'Followers', value: formatCompactNumber(followersCount) }, { label: 'Members', value: formatCompactNumber(group.counts?.members) }, { label: 'Artworks', value: formatCompactNumber(group.counts?.artworks) }, { label: 'Collections', value: formatCompactNumber(group.counts?.collections) }, ] return (