All files / web/src/components/song-share SharedSongPlayerCard.tsx

0% Statements 0/20
0% Branches 0/1
0% Functions 0/1
0% Lines 0/20

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21                                         
'use client'

/**
 * Client wrapper around `SyncedLyricsPlayer` for the public song-share page.
 *
 * The share page is a server component and can't pass function props across
 * the server/client boundary, so this thin shell holds the `onFirstPlay`
 * handler that fires the celebration confetti the first time the song
 * actually starts playing (per-mount; pause/resume does not re-fire).
 */

import { SyncedLyricsPlayer } from '@/components/song/SyncedLyricsPlayer'
import type { SyncedLyricsPlayerProps } from '@/components/song/SyncedLyricsPlayer'
import { fireConfettiCelebration } from '@/utils/confetti'

type Props = Omit<SyncedLyricsPlayerProps, 'onFirstPlay'>

export function SharedSongPlayerCard(props: Props) {
  return <SyncedLyricsPlayer {...props} onFirstPlay={fireConfettiCelebration} />
}