feat: chat reactions
This commit is contained in:
@@ -37,6 +37,7 @@ export function ChatComposer({
|
||||
replyTo,
|
||||
onCancelReply,
|
||||
onSend,
|
||||
onTyping,
|
||||
conversationId,
|
||||
disabled = false,
|
||||
placeholder = "Message…",
|
||||
@@ -45,6 +46,8 @@ export function ChatComposer({
|
||||
conversationId: string;
|
||||
replyTo: ChatMessage | null;
|
||||
onCancelReply: () => void;
|
||||
/** Called on each keystroke; throttled by the caller. */
|
||||
onTyping?: () => void;
|
||||
onSend: (
|
||||
body: string,
|
||||
replyToId?: string,
|
||||
@@ -257,7 +260,13 @@ export function ChatComposer({
|
||||
value={value}
|
||||
disabled={disabled}
|
||||
placeholder={placeholder}
|
||||
onChange={(e) => setValue(e.target.value)}
|
||||
onChange={(e) => {
|
||||
setValue(e.target.value);
|
||||
// Fired on every keystroke; the handler throttles itself, so the
|
||||
// thread hears "still typing" every few seconds rather than per
|
||||
// character.
|
||||
onTyping?.();
|
||||
}}
|
||||
onKeyDown={(e) => {
|
||||
// Enter sends on a physical keyboard; Shift+Enter makes a newline.
|
||||
// On touch keyboards Enter must insert a newline instead — there is
|
||||
|
||||
Reference in New Issue
Block a user