Renders a message the user sent to the chat that the server hasn't echoed back yet, at the end of the chat modal's list.
f
PendingItem(unnamed 0: PendingItemProps): React.JSX.Element
Renders a pending message, dimmed while it is sending. Once it has failed, it shows why and offers to retry it, edit it in the composer, or discard it.
I
PendingItemProps
Passed to PendingItem by ChatModal for each of WSChatContext's
pendingChatMessages.
-
grouped: boolean
Set when it continues the user's run, which hides the avatar and name.
- onDiscard: (nonce: string) => void
- onJumpTo: (id: string) => void
-
onRestore: (pending: PendingChatMessage) => void
Takes the failed text back into the composer, and discards it.
- onRetry: (nonce: string) => void
- pending: PendingChatMessage
-
user: PublicUser
The signed-in user, who sent it.
Usage
import * as mod from "src/components/chat/PendingItem.tsx";