'use client'; import { Reactions } from './Reactions'; import { SERVICE_LABELS, openUrl, timeAgo, type ProfileDTO, type RecentPlayDTO, type StreamingService } from '@musicshare/shared'; export function RecentPlays({ plays, preferred, attribution = {}, ownerId, }: { plays: RecentPlayDTO[]; /** Whose plays these are (they can't react to their own). */ ownerId: string; preferred: StreamingService | null | undefined; attribution?: ProfileDTO['attribution']; }) { const credits = (['lastfm', 'listenbrainz'] as const).filter((s) => attribution[s] && plays.some((p) => p.source === s)); if (plays.length === 0) return null; return (

Recently played

{credits.map((s) => (

Some plays via{' '} {s === 'lastfm' ? 'Last.fm' : 'ListenBrainz'}

))}
); }