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-playerUsage
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
| Prop | Type | Default | Description |
|---|---|---|---|
| voicemail | Voicemail | — | The voicemail to render. |
| onExpired | (id) => Promise<Voicemail> | — | Fetch a fresh voicemail when the audio URL has expired. |
| className | string | — | Merged onto the card. |
| Prop | Type | Default | Description |
|---|---|---|---|
| tenantId | string | — | Scope to one tenant (usually handled server-side). |
| pollMs | number | 15000 | Refresh interval. 0 disables polling. |
| limit | number | 25 | Page size. |
| className | string | — | Merged onto the list wrapper. |