Skip to content
Twentyfirst UIHalo

Message Preview

AI · MessagePreview, ApprovalCard

View as Markdown

A message to a customer, or a post, exactly as it goes out: the channel (name and icon; register a brand icon for the logo), the recipient masked (maskRecipient()), the sending account, the reply window (open, closing, closed) for channels that only allow free text for a while after the customer's last message, the last messages of the conversation for context, and the text or a pre-approved template with its category and parameters. Posts show their image or video (media). Ends with "Goes out once after A".

Approval neededAtlas · SupportCommunication6 min

Reply to a customer on WhatsApp

Atlas answers in the open reply window; replies need your OK.

Channel
WhatsApp
Recipient
Erika L. (…5678)
From
+49 30 1234 5000
Reply window
Closes at Apr 16, 6:20 PM
Last messages
  1. Customer · Apr 15, 6:20 PMHi, my order 2041 still says processing.
  2. You · Apr 15, 6:24 PMThanks, I will check with the warehouse.
  3. Customer · Apr 16, 9:02 AMAny news? I need it by Friday.
Text that goes out
Good news: order 2041 left the warehouse this morning and arrives Thursday. Tracking: NW-55102.

Goes out once after A, exactly as shown.

Approval neededSocial · MarketingMarketing12 min

Publish a post on Instagram

Channel
WhatsApp
Recipient
Noah B. (…7731)
Reply window
Closed since Apr 14, 11:00 AM
Template
order_update (en)Category: Utility
Text that goes out
  1. {{1}} Noah
  2. {{2}} 2058
  3. {{3}} Thursday

Goes out once after A, exactly as shown.

Props

MessagePreview

PropTypeNotes
title?ReactNodeOne line: "Reply to Erika M. on WhatsApp".
channelstringThe channel's name ("WhatsApp", "Instagram", "SMS").
channelIcon?IconNameThe channel's icon (default `send`); register brand icons to show the logo.
recipient?stringAlready masked, or pass it through `maskRecipient`.
sender?stringThe account it is sent from.
window?{ state: "open" | "closing" | "closed"; until?: Date | string | number }Messaging windows (e.g. 24 hours after the customer's last message).
context?MessagePreviewContext[]The last messages, oldest first.
text?stringExactly what goes out.
template?{ name: string; category?: string; language?: string; params?: string[] }A pre-approved template instead of free text.
media?{ kind: "image" | "video"; src: string; alt?: string; poster?: string }The image or video of a post.
warnings?ReactNode[]
facts?KeyValueItem[]
className?stringExtra class on the root element.
style?CSSPropertiesInline style on the root element.

ApprovalCard

PropTypeNotes
titleReactNodeRequired
text?ReactNode
children?ReactNode
agent?string
project?string
family?RiskFamily
familyLabel?string
age?string
escalation?ReactNode
trace?ReactNode
note?ReactNode
heading?string
options?ApprovalOption[]
approveLabel?string
onDecide?(key: ApprovalKey, text?: string) => void | Promise<unknown>Called with the answer (and the text of B or D). Return a Promise to keep the card busy until it settles: the answer's button spins and every answer is disabled; a rejection shows an error (a rejected string is shown as is) and keeps the card open. Once it resolves, a card without a `decision` prop collapses to its one-line record; with a plain callback, set `decision` yourself.
decision?ApprovalDecision | nullThe decision record: shown as one line instead of the card; `null` keeps the card open.
compact?booleanSide panels: tighter, the answers in a row, the payload folded behind "Show what runs" (one click, never a summary).
stepUp?booleanMoney, legal and infrastructure decisions: A and B (the answers that run something) need a fresh passkey. They show "Needs your passkey"; while `onDecide` is pending the pressed answer says "Confirm with passkey". Do the WebAuthn step-up in `onDecide` and reject if it fails.
busy?ApprovalKey | nullThe answer being sent, when you track it yourself (controlled busy state).
error?ReactNodeAn error to show above the answers (controlled); a rejected `onDecide` shows one by itself.
screen?booleanFills its container, e.g. a deep link on a phone: the content scrolls and A–D stay at the bottom, full width, in thumb reach (with the safe area).
href?stringMakes the title a link to the full approval (with `linkAs` for a router's link).
linkAs?ElementType
onApprove?() => void
onDeny?() => void
onEdit?(text: string) => void
state?"approved" | "denied"
className?stringExtra class on the root element.
style?CSSPropertiesInline style on the root element.