MCPcopy Create free account
hub / github.com/ResearAI/AutoFigure / handleFileChange

Function handleFileChange

frontend/components/chat-input.tsx:221–232  ·  view source on GitHub ↗
(e: React.ChangeEvent<HTMLInputElement>)

Source from the content-addressed store, hash-verified

219 }
220
221 const handleFileChange = (e: React.ChangeEvent<HTMLInputElement>) => {
222 const newFiles = Array.from(e.target.files || [])
223 const { validFiles, errors } = validateFiles(newFiles, files.length)
224 showValidationErrors(errors)
225 if (validFiles.length > 0) {
226 onFileChange([...files, ...validFiles])
227 }
228 // Reset input so same file can be selected again
229 if (fileInputRef.current) {
230 fileInputRef.current.value = ""
231 }
232 }
233
234 const handleRemoveFile = (fileToRemove: File) => {
235 onFileChange(files.filter((file) => file !== fileToRemove))

Callers 1

ChatPanelFunction · 0.70

Calls 2

validateFilesFunction · 0.85
showValidationErrorsFunction · 0.85

Tested by

no test coverage detected