import React from 'react' import GroupBadgePill from './GroupBadgePill' import { formatProfileNumber } from '../../lib/profileFormatters' export function normalizeGroupContribution(entry = {}) { const counts = entry?.counts || {} const role = entry?.role return { ...entry, roleLabel: typeof role === 'string' ? role : role?.label || null, trusted: entry?.trusted_indicator ?? entry?.trusted ?? false, counts: { ...counts, credited_artworks: counts.credited_artworks ?? counts.artworks ?? 0, releases: counts.releases ?? 0, projects: counts.projects ?? 0, review_actions: counts.review_actions ?? 0, }, role_labels: Array.isArray(entry?.role_labels) ? entry.role_labels : [], recent_release_titles: Array.isArray(entry?.recent_release_titles) ? entry.recent_release_titles : [], } } export default function GroupProfileSummary({ contributions = [], href = null }) { if (!Array.isArray(contributions) || contributions.length === 0) return null const featured = contributions.slice(0, 3).map(normalizeGroupContribution) return (
Group footprint

Collaborative work across public groups

See the groups this creator contributes to through releases, credited artworks, and shared publishing activity.

{href ? View full contribution history : null}
{featured.map((entry) => (
{entry.group?.avatar_url ? {entry.group?.name} : }
{entry.group?.name}
{entry.roleLabel ?
{entry.roleLabel}
: null} {entry.summary ?
{entry.summary}
: null}
{entry.trusted ? : null} {entry.recent_release_titles?.length ? : null} {entry.role_labels.map((label, index) => )}
{entry.recent_release_titles.length ? (
Recent releases:{' '} {entry.recent_release_titles.join(', ')}
) : null}
{formatProfileNumber(entry.counts.credited_artworks)} artworks {formatProfileNumber(entry.counts.releases)} releases {formatProfileNumber(entry.counts.projects)} projects {formatProfileNumber(entry.counts.review_actions)} reviews
))}
) }