MCPcopy Index your code
hub / github.com/e2b-dev/fragments / handleFileInput

Function handleFileInput

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

Source from the content-addressed store, hash-verified

43 children: React.ReactNode
44}) {
45 function handleFileInput(e: React.ChangeEvent<HTMLInputElement>) {
46 handleFileChange((prev) => {
47 const newFiles = Array.from(e.target.files || [])
48 const uniqueFiles = newFiles.filter((file) => !isFileInArray(file, prev))
49 return [...prev, ...uniqueFiles]
50 })
51 }
52
53 function handleFileRemove(file: File) {
54 handleFileChange((prev) => prev.filter((f) => f !== file))

Callers

nothing calls this directly

Calls 2

isFileInArrayFunction · 0.90
handleFileChangeFunction · 0.85

Tested by

no test coverage detected