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
voicemailVoicemail—The voicemail to render.
onExpired(id) => Promise<Voicemail>—Fetch a fresh voicemail when the audio URL has expired.
classNamestring—Merged onto the card.
VoicemailList
PropTypeDefaultDescription
tenantIdstring—Scope to one tenant (usually handled server-side).
pollMsnumber15000Refresh interval. 0 disables polling.
limitnumber25Page size.
classNamestring—Merged onto the list wrapper.