Voicemail player

Voicemails with playback and transcripts. Ships as two pieces: VoicemailPlayer for a single message, VoicemailList for the whole mailbox.

Installation

npx shadcn@latest add @handset/voicemail-player

Usage

import { VoicemailList, VoicemailPlayer } from "@/components/handset/voicemail-player";

// The whole mailbox:
<VoicemailList />

// One voicemail, e.g. inside a call detail view:
<VoicemailPlayer voicemail={vm} onExpired={refreshVoicemail} />

Audio URLs from the API are presigned and expire after an hour. When playback fails, the player calls onExpired to fetch a fresh URL and retries once — useVoicemails(...).refreshVoicemail slots straight in (the list wires this for you). Transcripts appear under the scrubber; a voicemail still transcribing shows "Transcribing…" and fills in on the next poll.

Props

VoicemailPlayer
PropTypeDefaultDescription
voicemailVoicemailThe voicemail to render.
onExpired(id) => Promise<Voicemail>Fetch a fresh voicemail when the audio URL has expired.
classNamestringMerged onto the card.
VoicemailList
PropTypeDefaultDescription
tenantIdstringScope to one tenant (usually handled server-side).
pollMsnumber15000Refresh interval. 0 disables polling.
limitnumber25Page size.
classNamestringMerged onto the list wrapper.