Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

Add actions slot and input class to MessageInput

Rafi0368dd529e53
diff --git a/apps/web/ui/shared/message-input.tsx b/apps/web/ui/shared/message-input.tsx
index 2905b11307..0c554f88ad 100644
--- a/apps/web/ui/shared/message-input.tsx
+++ b/apps/web/ui/shared/message-input.tsx
@@ -23,6 +23,7 @@ import { cn, formatFileSize, nFormatter } from "@dub/utils";
import { File, Paperclip, X } from "lucide-react";
import {
DragEvent,
+ ReactNode,
useCallback,
useEffect,
useMemo,
@@ -53,6 +54,8 @@ export function MessageInput({
placeholder = "Type a message...",
sendButtonText = "Send",
className,
+ inputClassName,
+ actions,
attachments = [],
onAddFiles,
onRemoveAttachment,
@@ -69,6 +72,8 @@ export function MessageInput({
placeholder?: string;
sendButtonText?: string;
className?: string;
+ inputClassName?: string;
+ actions?: ReactNode;
attachments?: PendingAttachment[];
onAddFiles?: (files: File[]) => void;
onRemoveAttachment?: (id: string) => void;
@@ -248,7 +253,7 @@ export function MessageInput({
},
}}
>
- <div className="relative">
+ <div className={cn("relative", inputClassName)}>
<RichTextArea />
<MessageInputEditorOverflowFades />
<InlineEmojiAutocomplete
@@ -280,6 +285,7 @@ export function MessageInput({
}
/>
<div className="flex items-center justify-between gap-2">
+ {actions}
{onCancel && (
<Button
variant="secondary"