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

Function handleDrop

frontend/components/chat-input.tsx:257–277  ·  view source on GitHub ↗
(e: React.DragEvent<HTMLFormElement>)

Source from the content-addressed store, hash-verified

255 }
256
257 const handleDrop = (e: React.DragEvent<HTMLFormElement>) => {
258 e.preventDefault()
259 e.stopPropagation()
260 setIsDragging(false)
261
262 if (isDisabled) return
263
264 const droppedFiles = e.dataTransfer.files
265 const supportedFiles = Array.from(droppedFiles).filter((file) =>
266 isValidFileType(file),
267 )
268
269 const { validFiles, errors } = validateFiles(
270 supportedFiles,
271 files.length,
272 )
273 showValidationErrors(errors)
274 if (validFiles.length > 0) {
275 onFileChange([...files, ...validFiles])
276 }
277 }
278
279 const handleClear = () => {
280 onClearChat()

Callers

nothing calls this directly

Calls 3

isValidFileTypeFunction · 0.85
validateFilesFunction · 0.85
showValidationErrorsFunction · 0.85

Tested by

no test coverage detected