{headline(activity)}
{copy ?{copy}
: null}import React from 'react' function typeMeta(type) { switch (type) { case 'upload': return { icon: 'fa-solid fa-image', label: 'Upload', tone: 'text-sky-200 bg-sky-400/12 border-sky-300/20' } case 'comment': return { icon: 'fa-solid fa-comment-dots', label: 'Comment', tone: 'text-amber-100 bg-amber-400/12 border-amber-300/20' } case 'reply': return { icon: 'fa-solid fa-reply', label: 'Reply', tone: 'text-orange-100 bg-orange-400/12 border-orange-300/20' } case 'like': return { icon: 'fa-solid fa-heart', label: 'Like', tone: 'text-rose-100 bg-rose-400/12 border-rose-300/20' } case 'favourite': return { icon: 'fa-solid fa-bookmark', label: 'Favourite', tone: 'text-pink-100 bg-pink-400/12 border-pink-300/20' } case 'follow': return { icon: 'fa-solid fa-user-plus', label: 'Follow', tone: 'text-emerald-100 bg-emerald-400/12 border-emerald-300/20' } case 'achievement': return { icon: 'fa-solid fa-trophy', label: 'Achievement', tone: 'text-yellow-100 bg-yellow-400/12 border-yellow-300/20' } case 'forum_post': return { icon: 'fa-solid fa-signs-post', label: 'Forum thread', tone: 'text-violet-100 bg-violet-400/12 border-violet-300/20' } case 'forum_reply': return { icon: 'fa-solid fa-comments', label: 'Forum reply', tone: 'text-indigo-100 bg-indigo-400/12 border-indigo-300/20' } default: return { icon: 'fa-solid fa-bolt', label: 'Activity', tone: 'text-slate-100 bg-white/6 border-white/10' } } } function profileName(actor) { if (!actor) return 'Creator' return actor.username ? `@${actor.username}` : actor.name || 'Creator' } function headline(activity) { switch (activity?.type) { case 'upload': return activity?.artwork?.title ? `Uploaded ${activity.artwork.title}` : 'Uploaded new artwork' case 'comment': return activity?.artwork?.title ? `Commented on ${activity.artwork.title}` : 'Posted a new comment' case 'reply': return activity?.artwork?.title ? `Replied on ${activity.artwork.title}` : 'Posted a reply' case 'like': return activity?.artwork?.title ? `Liked ${activity.artwork.title}` : 'Liked an artwork' case 'favourite': return activity?.artwork?.title ? `Favourited ${activity.artwork.title}` : 'Saved an artwork' case 'follow': return activity?.target_user ? `Started following @${activity.target_user.username || activity.target_user.name}` : 'Started following a creator' case 'achievement': return activity?.achievement?.name ? `Unlocked ${activity.achievement.name}` : 'Unlocked a new achievement' case 'forum_post': return activity?.forum?.thread?.title ? `Started forum thread ${activity.forum.thread.title}` : 'Started a new forum thread' case 'forum_reply': return activity?.forum?.thread?.title ? `Replied in ${activity.forum.thread.title}` : 'Posted a forum reply' default: return 'Shared new activity' } } function body(activity) { if (activity?.comment?.body) return activity.comment.body if (activity?.forum?.post?.excerpt) return activity.forum.post.excerpt if (activity?.achievement?.description) return activity.achievement.description return '' } function cta(activity) { if (activity?.comment?.url) return { href: activity.comment.url, label: 'Open comment' } if (activity?.artwork?.url) return { href: activity.artwork.url, label: 'View artwork' } if (activity?.forum?.post?.url) return { href: activity.forum.post.url, label: 'Open reply' } if (activity?.forum?.thread?.url) return { href: activity.forum.thread.url, label: 'Open thread' } if (activity?.target_user?.profile_url) return { href: activity.target_user.profile_url, label: 'View profile' } return null } function AchievementIcon({ achievement }) { const raw = String(achievement?.icon || '').trim() const className = raw.startsWith('fa-') ? raw : `fa-solid ${raw || 'fa-trophy'}` return (
{copy}
: null}