You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/chat/components/chat-file-upload.tsx
+9-2Lines changed: 9 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -21,6 +21,7 @@ interface ChatFileUploadProps {
21
21
maxSize?: number// in MB
22
22
acceptedTypes?: string[]
23
23
disabled?: boolean
24
+
onError?: (errors: string[])=>void
24
25
}
25
26
26
27
exportfunctionChatFileUpload({
@@ -30,6 +31,7 @@ export function ChatFileUpload({
30
31
maxSize =10,
31
32
acceptedTypes =['*'],
32
33
disabled =false,
34
+
onError,
33
35
}: ChatFileUploadProps){
34
36
const[isDragOver,setIsDragOver]=useState(false)
35
37
constfileInputRef=useRef<HTMLInputElement>(null)
@@ -91,7 +93,7 @@ export function ChatFileUpload({
91
93
92
94
if(errors.length>0){
93
95
logger.warn('File upload errors:',errors)
94
-
// You could show these errors in a toast or alert
96
+
onError?.(errors)
95
97
}
96
98
97
99
if(newFiles.length>0){
@@ -168,7 +170,12 @@ export function ChatFileUpload({
0 commit comments