{activity.comment.body}
import React from 'react' import ActivityAvatar from './ActivityAvatar' import ActivityArtworkPreview from './ActivityArtworkPreview' import ActivityReactions from './ActivityReactions' function ActivityHeadline({ activity }) { const artworkLink = activity?.artwork?.url const artworkTitle = activity?.artwork?.title || 'an artwork' const storyLink = activity?.story?.url const storyTitle = activity?.story?.title || 'a story' const mentionedUser = activity?.mentioned_user const reaction = activity?.reaction const commentAuthor = activity?.comment?.author const targetUser = activity?.target_user switch (activity?.type) { case 'upload': if (storyLink) { return (
published {storyLink ? {storyTitle} : {storyTitle}}
) } return (published {artworkLink ? {artworkTitle} : {artworkTitle}}
) case 'favorite': return (favorited {artworkLink ? {artworkTitle} : {artworkTitle}}
) case 'follow': return (followed {targetUser?.profile_url ? @{targetUser.username || targetUser.name} : another creator}
) case 'award': return (awarded {artworkLink ? {artworkTitle} : {artworkTitle}}
) case 'story_like': return (liked {storyLink ? {storyTitle} : {storyTitle}}
) case 'story_comment': return (commented on {storyLink ? {storyTitle} : {storyTitle}}
) case 'comment': return (commented on {artworkLink ? {artworkTitle} : {artworkTitle}}
) case 'reply': return (replied on {artworkLink ? {artworkTitle} : {artworkTitle}}
) case 'reaction': return (reacted {reaction?.emoji || '👍'} {reaction?.label || 'Like'} to {commentAuthor?.profile_url ? {commentAuthor.name || commentAuthor.username || 'a creator'} : a creator} on {artworkLink ? {artworkTitle} : {artworkTitle}}
) case 'mention': return (mentioned {mentionedUser?.profile_url ? @{mentionedUser.username || mentionedUser.name} : someone} on {artworkLink ? {artworkTitle} : {artworkTitle}}
) default: returnShared new activity.
} } export default function ActivityCard({ activity, isLoggedIn = false }) { return ({activity.comment.body}